Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Tab Keystroke in Excel

Greetings,
I have data in Excel that I want to copy and paste into another application.
Each row in Excel has approx 13 cells of data to be pasted into 13 fields in
the other program.
The problem is that when I paste the data into the other application, the
cursor tries to paste all of the data into the field that it's currently in;
the cursor does not paste into the respecive fields in this other program.
When I manually press the TAB key the cursor will move, so I figured that if
I ingrain a TAB keystroke into my Excel data that it would work, but no luck.
Any ideas on this one. It's a lot of data to enter manually and the clock
is ticking for me. Thanks in advance.

Snakeoids.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default Tab Keystroke in Excel

Assuming it's not an ms office program (VBA would be the way to go) then
check out Application.SendKeys. You may want to use the Replace function to
change special characters in your text. For example, the plus sign "+" is
recognized as the Shift key instead of a plus sign.

This is an *illustrative* example that includes a routine to change special
characters recognized by the SendKeys method to their normal text. Not
tested:-

With Application
For Each c In Range("A1:A200").Cells
'Replace necessary for A1:A200 because contains text
txt = c.Value
txt = Replace(txt, "+", "{+}")
txt = Replace(txt, "%", "{%}")
txt = Replace(txt, "(", "{(}")
txt = Replace(txt, ")", "{)}")
txt = Replace(txt, "^", "{^}")
.SendKeys txt & "{TAB}", True
'Replace not necessary for c(1, 7) and c(1, 8) because numeric
.SendKeys c(1, 7) & "{TAB}{TAB}{TAB}", True
.SendKeys c(1, 8) & "{TAB}", True
Next
End With

Another problem with SendKeys is that it won't recognize an error state in
the destination program. If the dest. program pops up an error message it
will keep pounding away. I've used API code to continually check the window
caption to make sure it's what it's supposed to be. If not, abort. This would
probably be too confusing to post and the above should get you going.

Greg


"Snakeoids" wrote:

Greetings,
I have data in Excel that I want to copy and paste into another application.
Each row in Excel has approx 13 cells of data to be pasted into 13 fields in
the other program.
The problem is that when I paste the data into the other application, the
cursor tries to paste all of the data into the field that it's currently in;
the cursor does not paste into the respecive fields in this other program.
When I manually press the TAB key the cursor will move, so I figured that if
I ingrain a TAB keystroke into my Excel data that it would work, but no luck.
Any ideas on this one. It's a lot of data to enter manually and the clock
is ticking for me. Thanks in advance.

Snakeoids.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab Keystroke in Excel Snakeoids Excel Discussion (Misc queries) 2 April 13th 07 11:04 PM
How do I get Excel filename using a single keystroke David Excel Worksheet Functions 5 October 19th 06 09:18 PM
Shortcut Keystroke for Name Box L Lightner Excel Discussion (Misc queries) 0 July 28th 06 03:03 AM
Is there a keystroke shortcut to Group and Outline in Excel? jocapo Excel Discussion (Misc queries) 2 April 20th 06 01:20 AM
How to switch between worksheet tabs on excel via keystroke shortc JohnK Excel Discussion (Misc queries) 2 January 26th 06 03:09 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"