Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default find command using variables


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

--
eyecalibrat
-----------------------------------------------------------------------
eyecalibrate's Profile: http://www.excelforum.com/member.php...nfo&userid=662
View this thread: http://www.excelforum.com/showthread.php?threadid=26303

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
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
two sets of variables to find result Annette[_3_] Excel Discussion (Misc queries) 3 February 24th 09 09:42 PM
Range of variables with the 'floor' command included ReelDesigner Excel Worksheet Functions 0 January 26th 06 04:05 PM
Excel has a "Find Next" command but no "Find Previous" command. Michael Fitzpatrick Excel Discussion (Misc queries) 2 January 10th 05 11:45 PM
Input Command with Mainframe file and multiple variables BSchwerdt[_2_] Excel Programming 4 December 17th 03 11:47 PM
Variables in command lines Russell[_2_] Excel Programming 0 July 9th 03 11:34 AM


All times are GMT +1. The time now is 06:52 PM.

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

About Us

"It's about Microsoft Excel"