LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Starting at cell with string in VBA

Someone can probably improve on this, but
it is the 1st time I have actually tried to write code
FROM MEMORY (that is without use of using Help,
Google, etc) There probably is more to it than I
have included below, error checking etc..
But I'm estactic that what I put together actually
WORKED!! -- Of course it only brings back the
First row number instance of "period".

Sub tester()
Set rng = Range("A:A")
With rng
Set c = .Find(What:="period")
myrow = c.Row
MsgBox "It is in Row number " & myrow
End With
End Sub


" wrote:

Hi,

I want to create a macro that basically looks for a string in a certain
cell in column A, and then does some stuff starting in that row. How
can I define a variable to equal the row that has that string?

So, if I'm looking for the string "Period" in Column A, I want to
basically Find "Period" in A, and make the row number equal to myRow.

Thanks,
Brett


 
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
I need to change cell string lenths prior to upload into sql table kevt Excel Worksheet Functions 1 September 6th 06 06:44 PM
List File Properties - Author SS Excel Worksheet Functions 1 June 23rd 06 04:56 PM
Finding a text string w/in a Cell ricxl Excel Discussion (Misc queries) 12 March 20th 06 03:47 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 04:46 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"