LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default 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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox to validate an entry TimN Excel Programming 6 July 21st 06 09:08 PM
Validate InputBox entry davidm Excel Programming 0 August 31st 05 03:03 AM
Validate textbox entry Stuart[_21_] Excel Programming 2 May 13th 05 07:31 PM
Validate Combobox entry MBlake Excel Programming 5 May 4th 05 08:39 PM
Validate Textbox entry David Seebaran Excel Programming 3 April 18th 04 06:26 PM


All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"