I am trying to find a value in column A of a spreadsheet. This is what I have, but it seems to be going through the values of row 1 instead. What am I doing wrong?
Set rng = oExcel.Range("A1:A1000" 'I have tried ("A:A"
For Each range1 in rng
oExcel.Cells(range1).Activate
x = oExcel.ActiveCell.Value
msgbox (x)
Do while oExcel.ActiveCell.Value = var1
'Do Stuff
Loop
Next
Set rng = oExcel.Range("A1:A1000" 'I have tried ("A:A"
For Each range1 in rng
oExcel.Cells(range1).Activate
x = oExcel.ActiveCell.Value
msgbox (x)
Do while oExcel.ActiveCell.Value = var1
'Do Stuff
Loop
Next