Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tab Keystroke in Excel | Excel Discussion (Misc queries) | |||
How do I get Excel filename using a single keystroke | Excel Worksheet Functions | |||
Shortcut Keystroke for Name Box | Excel Discussion (Misc queries) | |||
Is there a keystroke shortcut to Group and Outline in Excel? | Excel Discussion (Misc queries) | |||
How to switch between worksheet tabs on excel via keystroke shortc | Excel Discussion (Misc queries) |