Validate Entry
After a User has entered data in a spreadsheet, I want to verify that the
data is valid. I assign a variable to the data I want to validate, go to the
table where the valid data resides and try to do a search but I get a message
"Object Variable or with Block Variable Not Set". Here is basically the code
I am using:
Sub Macro2()
Dim acct As Object
Dim searchfound As String
Cells(1, 1).Select
acct = "x"
Cells.Find(What:=acct, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
searchfound = ActiveCell.Value
If searchfound = acct Then
MsgBox ("Found it")
Else
MsgBox ("Did not find it")
End If
End Sub
|