How do I use Find to locate the first occurence of a particular value in a cell, and return the row that the cell is in?
Thanks in advance.
How do I use Find to locate the first occurence of a particular value in a cell, and return the row that the cell is in?
Thanks in advance.
Last edited by gshock; 03-05-2008 at 11:15 AM.
Maybe
see link for morePlease Login or Register to view this content.
http://www.ozgrid.com/VBA/find-method.htm
VBA Noob
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
VBA Noob,
That worked fantastic. I don't need the message box, but I want to take that row, and delete all rows above it. Can you tell me how to modify the code to do that?
Maybe
VBA NoobPlease Login or Register to view this content.
VBA Noob,
Outstanding! That worked great. Now, is there a way to isolate "STAGE" versus "Stage" and "stage"?
This is a data dump as a text file, and that word appears in different forms. But when it's in CAPS, it denotes the start of the data that I want to manipulate.
Thanks for your help. This is great.
Try
VBA NoobPlease Login or Register to view this content.
VBA Noob,
Bummer. That didn't work. The macro still runs, but it doesn't recognize the difference. That word occurs various times, depending on the size the of data that we get in the output file.
How do I combine the code you gave me with other code that I'm adding so that it all runs in one big macro? If I comment out Sub FindWord(), then I get the following error:
Run-time error '1004':
Method of 'Range of object '_Global' failed.
Thanks again. This is really helpful.
Last edited by gshock; 03-05-2008 at 12:05 PM.
Does on my sample pageThe macro still runs, but it doesn't recognize the difference.
Would have to see your code first.....remember to wrap code as per forum rules belowHow do I combine the code you gave me with other code that I'm adding so that it all runs in one big macro
VBA Noob
What I want to do is combine the code you gave me into the SXS_Data_Sort() macro that I'm trying to build. I want to have several operations contained within that one macro.
Thanks for your help.Please Login or Register to view this content.
Try
VBA NoobPlease Login or Register to view this content.
VBA Noob,
Thanks. Everything works great, but I'm still not getting it to differentiate between the variations of "Stage", "stage", and "STAGE". Do you want to see a sample of the data? And how do I upload it so you can see it?
Thanks a TON for your help. Much appreciated.
-gshock
Zip(Compress) the file then use the paperclip symbol to attach the file
VBA Noob
VBA Noob,
I tried the same code with this data, and it has the same result. It goes to the next occurence of the word 'stage' in any form, and deletes the rows above. I haven't listed all the data here, so you won't see "STAGE" as such. But if you run the macro, you'll see that it deletes a group of rows each time you run the macro.
Thanks so much for your help.
Your data doesn't contain a upper case "STAGE" so won't delete anything
VBA NoobB$1,1 "Stage Estimator Template File"
(stage 1
(stage 2
(stage 3
(stage 4
(stage 5
(stage 6
(stage 7
(stage 8
(stage 9
VBA Noob,
When I run the macro in my sheet, it will delete one set of 'stage' data at a time. So it's basically stepping through the data. I'm not sure why it sees the "STAGE" for you, and not me. Do I need to format the cells as text first?
Here's the data file down to the "STAGE" entry.
As per my post 6 you need to change
toPlease Login or Register to view this content.
VBA NoobPlease Login or Register to view this content.
VBA Noob,
Now, I'm learning. I didn't realize that I didn't change that piece. Now I see why it's important. Thanks. That worked great. Now, how can I modify that code to find a specific occurence of that? Say, for example, if I wanted to find the 4th occurence of that word, "STAGE".
This is excellent. Thank you so much for your help.
-gshock
Last edited by gshock; 03-05-2008 at 03:45 PM.
SOLVED
Thanks for all your help.
This finds the 4th and deletes
VBA NoobPlease Login or Register to view this content.
VBA Noob.
Thanks for all the help. I can't tell you how much you've improved my day.
Much appreciated.
-gshock
Your welcome
VBA Noob
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks