littlewoman
Programmer
Using VBA - Excel 2003
in short:
1 worksheet, lots of records on rows.
trying to get 1 or more records
first I used:
while activecell.value <> searchvalue then
activecell.offset(1,0).select
wend
works perfectly but with a large database it becomes slow on the less powerfull machines
now I thought using the autofilter.
but activecell.offset(1,0) doesnt recognize the filtered out rows and so the autofilter wend useless in this.
yet when you push on de downarrow-key by hand it jumps to the first filtered row
searching which code might do this trick, I found sendkeys
but it doesn't work,
Sheets(2).Select
Range("a1").Select
Selection.AutoFilter field:=1, Criteria1:=searchvalue
Application.SendKeys ("{DOWN}")
the space which occurs seems to indicate that there need to be more code but I don't know what.
not sure of the syntax involved I have tried also
SendKeys("{DOWN}") - no result
SendKeys("DOWN") - printed DOWN on codeline
Application.SendKeys(DOWN) - no result
Application.SendKeys {DOWN}- warning on usage "{"
so now I'm lost.
Am I making a syntax error or is sendkeys not to be used for this or what?
in short:
1 worksheet, lots of records on rows.
trying to get 1 or more records
first I used:
while activecell.value <> searchvalue then
activecell.offset(1,0).select
wend
works perfectly but with a large database it becomes slow on the less powerfull machines
now I thought using the autofilter.
but activecell.offset(1,0) doesnt recognize the filtered out rows and so the autofilter wend useless in this.
yet when you push on de downarrow-key by hand it jumps to the first filtered row
searching which code might do this trick, I found sendkeys
but it doesn't work,
Sheets(2).Select
Range("a1").Select
Selection.AutoFilter field:=1, Criteria1:=searchvalue
Application.SendKeys ("{DOWN}")
the space which occurs seems to indicate that there need to be more code but I don't know what.
not sure of the syntax involved I have tried also
SendKeys("{DOWN}") - no result
SendKeys("DOWN") - printed DOWN on codeline
Application.SendKeys(DOWN) - no result
Application.SendKeys {DOWN}- warning on usage "{"
so now I'm lost.
Am I making a syntax error or is sendkeys not to be used for this or what?