hi, i i have 10 data in a col and i want to have a loop to read till the ten col finish and extract specific data name only, how can i mae the loop??? data might increase
hi, i i have 10 data in a col and i want to have a loop to read till the ten col finish and extract specific data name only, how can i mae the loop??? data might increase
to use this:
it is set up now to search column A
put the search string in cell C1
don't remember where I came across this. I think its from Johns 1 line find kb entry
[vba]
Option Explicit
Sub GoToFnd()
Dim c As Range, FirstFound As String
Set c = Range("A:A").Find(what:=[C1], after:=[A1])
FirstFound = c.Address
c.Activate
Do Until MsgBox("Look for next", vbYesNo) = vbNo
Set c = Range("A:A").Find(what:=[C1], after:=c)
If c.Address = FirstFound Then
MsgBox "No more " & [C1]
Exit Sub
End If
c.Activate
Loop
End Sub
[/vba]
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
i think this loop is searching for a data name in the column... but wat if i have repeat name?? and i dunno how many of it i have as data is too much??Originally Posted by lucas
Hi
???Perhaps related to
http://vbaexpress.com/forum/showthread.php?t=8514
Tony
i did... but that was a infinite loop... and if i have only 5 of that name, it will loop all the was till my com can't move... it will add and add and add... the findadd nv matches the findit..Originally Posted by acw
Hi
Interesting. Didn't for me.
Open the 2 attached files. In Alvinkiang, run the macro runform. Enter aa into the textbox, then press the button. The 4 entries for aa should be brought across from Alvinkiang2.xls
Tony
hmmm... i think something is wrong with wat i have done...Originally Posted by acw
Sorry for that tony...