Message 1 of 10
Search Excel for a Value

Not applicable
01-06-2006
05:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a ton of this sort of worked out but I need to figure out how to solve this!
I want my app to have a user select a piece of text in autocad and it scane the first column in an excel file and when it finds the value of the textstring a msgbox says what the value in column 2 is...can anybody help me?
With oSheet
If LTrim(.Cells(2, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(2, 2))
End If
If LTrim(.Cells(3, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(3, 2))
End If
If LTrim(.Cells(4, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(4, 2))
End If
If LTrim(.Cells(5, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(5, 2))
End If
End With
I want my app to have a user select a piece of text in autocad and it scane the first column in an excel file and when it finds the value of the textstring a msgbox says what the value in column 2 is...can anybody help me?
With oSheet
If LTrim(.Cells(2, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(2, 2))
End If
If LTrim(.Cells(3, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(3, 2))
End If
If LTrim(.Cells(4, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(4, 2))
End If
If LTrim(.Cells(5, 1)) = oSpaceNo.Value Then 'Row then column)
MsgBox (.Cells(5, 2))
End If
End With