Hi All,
I'm trying to find the row number where a value (contract_number) is set in a specific column.
More exactly the VBA code is the following
contract_number = Sheet3.Cells(countR1, 15).Value
row_contract_number = Sheet12.Cells.Find(What:=contract_number, After:=Sheet12.Range("A1"), LookIn:=xlValues, LookAt:= xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If the value is present, this VBA code returns the number of the row but the value is not present (variable empty) the error message is the following
Run-time error '91':
Object variable or With block variable not set
I wont to test this variable, for example
IF row_contract_number > 0 THEN ... This check works if the data is found in the column.
Any suggestion will be well appreciate.
Thanks in advance for your kind support.
Regards,
Giovanni
I'm trying to find the row number where a value (contract_number) is set in a specific column.
More exactly the VBA code is the following
contract_number = Sheet3.Cells(countR1, 15).Value
row_contract_number = Sheet12.Cells.Find(What:=contract_number, After:=Sheet12.Range("A1"), LookIn:=xlValues, LookAt:= xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If the value is present, this VBA code returns the number of the row but the value is not present (variable empty) the error message is the following
Run-time error '91':
Object variable or With block variable not set
I wont to test this variable, for example
IF row_contract_number > 0 THEN ... This check works if the data is found in the column.
Any suggestion will be well appreciate.
Thanks in advance for your kind support.
Regards,
Giovanni