Databases Reference
In-Depth Information
FIGURE 1.8 Example Workbook for copying data.
Dim startrow As Integer, startcol As Integer
Dim row As Integer, col As Integer
'First Find the starting Positions of the Matrix
startrow = FindRow(FindPos("CopyExample", 1, "A", False, True ))
startcol = FindCol(FindPos("CopyExample", 1, "A", False, True))
+ 1
'Populate Public array WellPos using looping structure
For col = startcol To startcol + 11
For row = startrow To startrow + 7
WellPos((row - (startrow - 1)), (col - (startcol - 1))) = _
Workbooks("CopyExample.xls").Worksheets(1).Cells(row,
col).Value
Next row
Next col
End Sub
There are several comments worth making about this subroutine. First, notice that when utilizing
the FindPos function, the MatchCase parameter must be set to True. Otherwise, the FindPos
function will return cell A2 as there is a lower case “A” in the string “Measurement count: 1” that resides
in cell A2. Also notice that when using the FindCol function to determine the location of the starting
Search WWH ::




Custom Search