View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Multiple Sendkeys not working... need help to condense code

Dim sKeys As String
Dim n as long
n = 20
sKeys = "A" & String(n, vbTab) & "B"
application.sendkeys sKeys

Regards,
Peter T


"Mr. m0le" wrote in message
...
Yeah, it looks that way. I ended up creating several variables for the
tab
amounts i needed.

"r" wrote:

I believe that you can only
"<Tab<Tab<Tab<Tab<Tab<Tab<Tab<Tab<Tab<Tab <Tab<Tab<Tab<Tab<Tab<Tab<Tab<Tab<Tab<Tab "
regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"Mr. m0le" wrote:

All this does is put {Tab 20} as text into the application...

"r" wrote:

Application.SendKeys "{TAB 20}"

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"Mr. m0le" wrote:

I'm using the sendkeys command to send different key strokes to an
outside
program already running. Normally this isn't an issue except for
this macro
i'm putting together i have 20+ sendkeys in a row just to get to
where i need
the cursor. I looked in MS Help files and it said to just put a
space
between the key and how many strokes but either vb gives me a code
error or
it puts some combination of the word tab and the number used or
"tabs" once
then the number.

here is an example of what I was trying to do;
main.screen.sendkeys ("<tab 20") this just puts the word and
number into
the program instead of the actuall key stroke. I've tried all
different
kinds of combinations to get it to work but without luck. Also,
the sendkeys
command for it to work that i've seen so far is to have the key
setup like so
("<KEY").

Anyone have any ideas on how i can condense my many sendkeys
commands?