G
Guest
I am using VBScript to automate Excel through another program. I have written
some data to a row in the Excel worksheet. This part works perfectly.
I then need to look for a value in the row and get the address of the cell
where that value is located. The problem I am having is that the find
function is returning the wrong cell. When I look for the value 1, it will
return any cell in which the value contains a '1' such as cells with values
of 11, 21, or 111. Is there a parameter I need to change or a workaround for
this?
Here is a short sample of my code:
dim lookupval
dim myLoc
lookupval = 1
set myLoc =
objExcel.workbooks(1).worksheets(1).Range("A2:Z2").Find(CInt(lookupVal))
msgbox myLoc.column
some data to a row in the Excel worksheet. This part works perfectly.
I then need to look for a value in the row and get the address of the cell
where that value is located. The problem I am having is that the find
function is returning the wrong cell. When I look for the value 1, it will
return any cell in which the value contains a '1' such as cells with values
of 11, 21, or 111. Is there a parameter I need to change or a workaround for
this?
Here is a short sample of my code:
dim lookupval
dim myLoc
lookupval = 1
set myLoc =
objExcel.workbooks(1).worksheets(1).Range("A2:Z2").Find(CInt(lookupVal))
msgbox myLoc.column