Databases Reference
In-Depth Information
RowOrigin = FindRow(FindPos2(CalcBook, SGDataSheet, "A"))
RowPos = RowOrigin
For ii = 1 To 100
If RowPos > TRows Then Exit For
NoScans = NoScans + 1
RowPos = RowPos + 10
Next ii
If UtilScans > NoScans Then
msg$ = "Fatal Error: " & "Total Scans in File = " &
str(NoScans) & " Scans to Utilize = " & str(UtilScans) & "!"
MsgBox "You wish to Utilize More Scans than the Data File
has Stored!", vbCritical + vbOKOnly, msg$
End
End If
For col = 0 To 11
For row = 0 To 7
For CellPos = 1 To UtilScans
Select Case CellPos
Case UtilScans 'Omit ","
cellstr$ = cellstr$ & SGDataSheet & "!" &
Chr(ColOrigin + 64 + col) & _
Trim(str((RowOrigin + row + (CellPos
- 1) * 10)))
Case Else
cellstr$ = cellstr$ & SGDataSheet & "!" &
Chr(ColOrigin + 64 + col) & _
Trim(str((RowOrigin + row + (CellPos - 1)
* 10))) & ","
End Select
'Color Out of Spec Cells in Original Data
If WithinSpec
(Workbooks(CalcBook).Worksheets(SGDataSheet).range(Chr(
ColOrigin + 64 + col) & _ Trim(str((RowOrigin + row +
(CellPos - 1) * 10)))).Value) = False Then
'Out of Spec - Color Cell
Call ColorCell
(CalcBook, SGDataSheet, (Chr(ColOrigin +
64 + col) & _
Trim(str((RowOrigin + row + (CellPos -
1) * 10)))))
End If
Next CellPos
funcstr$ = "=AVERAGE(" & cellstr$ & ")"
Call AddFormula
(CalcBook, "AVG", ((row + 7)), ((col + 2)), funcstr$)
CellAvg(row + 1, col + 1) = Worksheets("AVG").Cells(row + 7,
col + 2).Value
Search WWH ::




Custom Search