View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default find command using variables

Hi Eyecalibrate,

Sub Tester()
Dim rng As Range
Dim myVar1 As String

myVar1 = "ABC"

With ActiveSheet.Columns("A:A")
Set rng = .Find(myVar1, LookIn:=xlValues)
If Not rng Is Nothing Then
MsgBox rng.Address
Else
MsgBox myVar1 & " not found in specified range"
End If
End With

End Sub

---
Regards,
Norman



"eyecalibrate" wrote in message
...

Help. I'm having trouble using an established variable in a find. I
want to find a certain value in...say column A. Probably a syntax
error on my part. I can't seem to find a way to use "MyVar1" as a
value in a find. Any suggestions?


--
eyecalibrate
------------------------------------------------------------------------
eyecalibrate's Profile:
http://www.excelforum.com/member.php...fo&userid=6621
View this thread: http://www.excelforum.com/showthread...hreadid=263032