Differences between Excel 2003 and Excel 2000
I think this will workalthough it is untested:
RegNo = InputBox("Enter the Original Reg No or Present Reg No", Title)
On Error Resume Next
Application.ScreenUpdating = False
With Sheets("Register")
.Activate
.Columns("C:D")
Set C = .Find(What:=RegNo, After:=.Cells(1, 3),
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False, SearchFormat:=False).Activate
If C < Empty Then
MsgBox "Registration Number " & RegNo & " Found at " & C.Address
Else
MsgBox "Registration Number not found"
End If
If Err = "91" Then
Response = MsgBox("Registration Not Found", , Title)
ScrollBar1.Value = ScrollBar1.Min
Exit Sub
End If
End With
On Error GoTo 0
"JRB @eclipse.co.uk" wrote:
Thanks Bob - code is called from a button on a user form as follows:
...................
RegNo = InputBox("Enter the Original Reg No or Present Reg No", Title)
On Error Resume Next
Application.ScreenUpdating = False
With Sheets("Register")
.Activate
.Columns("C:D").Find(What:=RegNo, After:=.Cells(1, 3),
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False, SearchFormat:=False).Activate
If Err = "91" Then
Response = MsgBox("Registration Not Found", , Title)
ScrollBar1.Value = ScrollBar1.Min
Exit Sub
End If
End With
On Error GoTo 0
.............................
Does it look ok to you ?
Regards
"Bob Phillips" wrote in message
...
Find will not work in 2000 if included in a function called from a
worksheet
formula.
--
HTH
Bob Phillips
(replace xxxx in the email address with gmail if mailing direct)
"JRB @eclipse.co.uk" <sa3214<nospam wrote in message
...
Are there any significant differences between the vba Find Method in the
2003 and 200 versions of Excel
The reason I ask is that I have some code that works in version 2003 and
yet
doesn't work in my friends version which is 2000
Regards
and TIA
|