I have the following code:
- It is assumed that he enters the sheet with the name "Flash" and receives the i-th two-digit numerical value and extracts the value in the offset of column 4 to the right of Activecell.
- Then go to the sheet named "Sheet1" in the same book and use the "Vertical Search" function to find the value obtained and return the value of 4 columns to the right of this cell.
However, when I run the script below, it stops working with:
MsgBox (ActiveSheet.VLookup(LookFor, "A:A", 4, True))
and VBA throws error 438 object doesn't support this property or method
Does anyone know why an exception exists?
' Begin lookup : Dim i As Integer, designator As String, LookFor As String Flash.Activate ActiveSheet.Range("C3").Select For i = 3 To lastUsedCellInRow("C") designator = "C" + CStr(i) Dim cellVal As String cellVal = ActiveSheet.Range(designator).Value() If (Len(cellVal) <= 2 And IsNumeric(cellVal)) Then LookFor = ActiveSheet.Range(designator).Offset(0, 4).Value() RawData.Activate MsgBox (ActiveSheet.VLookup(LookFor, "A:A", 4, True)) End If Next i
source share