Tidying up VB...

M

MarkHear1

Hi All,

I have written a quite simple VB script, and have got a section that I
would like to "tidy up"
If anybody could offer any suggestions they would be greatly
appreciated. The section of script is below:
Application.Wait Now + TimeValue("00:00:5")
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{ENTER}"

Many Thanks,
Mark
 
M

MarkHear1

They are there to tab through options on a website on IE
I was wondering if there was maybe a loop that i could use?

Thanks,
Mark
 
N

Nick Hodge

Mark

Ah, right, well you could use a for x = 1 to 10 type loop, but I doubt it
will be significantly quicker

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk
 
M

MarkHear1

Nick,

Ok then, thank you for your help.
I will look into this option, do you know of anywhere that I can read
up on this type of loop?

Thank you,
Mark
 
J

Jim Cone

Another way...
SendKeys "{Tab 16}", True
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"MarkHear1" <[email protected]>
wrote in message
Hi All,
I have written a quite simple VB script, and have got a section that I
would like to "tidy up"
If anybody could offer any suggestions they would be greatly
appreciated. The section of script is below:
Application.Wait Now + TimeValue("00:00:5")
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{tab}", True
SendKeys "{Tab}", True
SendKeys "{tab}", True
SendKeys "{ENTER}"
Many Thanks,
Mark
 
M

MarkHear1

Jim,

Thank you very much for this.
While i have your attention (if i still do) could i please pick your
brains with another VB query? :)

Many Thanks,
Mark
 
M

MarkHear1

Yes it will be used on other peoples computers, however i have no
knowledge of activeX and would probably end up in a right mess!!!
Unfortunately that website is blocked for me at work.

Thank you,
Mark
 
J

jlepack

Hah! It's blocked because it has a link to a word like "D. Hicks"
blog.

Someones web filtering is sensitive.
 
B

Bob Phillips

It won't be quicker Mark, it will be slower, and will be less clear IMO. I
wouldn't bother personally.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 
M

MarkHear1

Possibly, although i think it might just be because it's link a message
board (somehow it allows access to google message groups) but it's
quite strict on message boards usually.
 
M

MarkHear1

Hi Bob,

Thank you for your response, i some how managed to miss yours when i
checked earlier.

I am now about to start a new topic about VB again, so if anybody
fancies helping me with that .... :)

Regards,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top