Thread: VB Code
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default VB Code

Dim c As Range

On Error Resume Next
Set c = Range("Range_1").Find("Something")
On Error Goto 0
If c Is Nothing Then
Msgbox "Not Found
Else
Msgbox "Found"
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Hal" wrote in message
...
I spent what seemed a lifetime learning excel macro language and now think
its about time I embraced this new fangled vb code. I cannot seem to grasp
how error checking works in vb, it was so simple in macro language. I'm

sure
its as simple in vb, but I need some guidance.


Can somebody please help with the vb code for the following macro4 code.

A1=SELECT("Range_1")
A2=ERROR(FALSE)
A3=FORMULA.FIND("Something")
A4=IF(A3=TRUE,GOTO(A7))
A5=ALERT("Not found")
A6=HALT()
A7=ALERT("Found")
A8=HALT()