Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 7
Default Macro to copy to application

Hi

I want to create a macro which will copy data in cell from excel to another application.

I need to macro to run through column A copy the first cell (A1), and paste it an external application, The go to B2 in excel copy and paste in application and do the same until it reaches a blank cell and the macro stops.

I have the basic concept to work the sendkeys with the application, but Im stuck how to loop in excel and proceed down the columns until it reaches a blank cell.

Any Suggestions?

Code:
 Sub copy()


'
'Excel Sheet
    Selection.Copy

'Activate Application
    AppActivate "appname"
    Delay 1
    SendKeys "{HOME}{TAB 7}", True
    SendKeys "%(EP)", True
    SendKeys "{F2}", True
    
  End Sub
  #2   Report Post  
Junior Member
 
Posts: 7
Question

If I do it in a loop would it work??


Do While Not IsEmpty(ActiveCell.Offset(0, 1))

ActiveCell.Selection.Copy

ActiveCell.Offset(1, 0).Select

'Activate Application
AppActivate "appname"
Delay 1
SendKeys "{HOME}{TAB 7}", True

'EP=Edit Paste
SendKeys "%(EP)", True
SendKeys "{F2}", True


Loop

End Sub
  #3   Report Post  
Junior Member
 
Posts: 7
Thumbs up

Got it working, hope it helps others.

Quote:
Sub APPS()
Dim r As Long
r = 2
c = 2
r1 = 2
c2 = 2


Do Until Cells(r, 1).Value = ""

'Copy from Column A

Cells(r, 1).Select
Selection.Copy

'Activate Apps Name
AppActivate "AppName"
Delay 1
'Navigate & Paste
SendKeys "{HOME}", 200
SendKeys "{TAB}", 200
SendKeys "{TAB}", 200
SendKeys "%(EP)", 200
SendKeys "{ENTER}", 200


'Copy from Column B
Cells(c, 2).Select
Selection.Copy

'Activate Apps Name
AppActivate "AppName"

'Navigate & Paste
SendKeys "{HOME}", 200
SendKeys "{TAB}", 200
SendKeys "{TAB}", 200
SendKeys "{TAB}", 200
SendKeys "%(EP)", 200
SendKeys "{ENTER}", 200

r = r + 1
r1 = r1 + 1
c = c + 1


Loop

MsgBox "COMPLETE", vbOKOnly, "INFORMATION"

End Sub
  #4   Report Post  
Junior Member
 
Posts: 1
Default

Quote:
Originally Posted by MrPetreli View Post
Got it working, hope it helps others.
Hi MrPetreli,

I have a similar need as yours. I need a macro to copy text in cell A1 and paste it on certain tab ( Email Address ) in another application. I have searched the net and you seem to the only one to have got any closer to solving it. I am a novice and dont have knowledge of VBA. Any help for creating such a macro would greatly be appreciated.

Best Wishes,
Anwaar
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
Excel opening new copy of application for each file Michelle Excel Discussion (Misc queries) 2 July 31st 09 08:02 AM
Copy/paste from other application without delimiting it? Jennifer Excel Discussion (Misc queries) 2 December 10th 08 11:49 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
Copy data from an external application into Excel Candide Excel Programming 3 July 14th 04 08:00 PM
Copy 2 application references Dominique Feteau Excel Programming 1 February 26th 04 07:11 PM


All times are GMT +1. The time now is 04:43 PM.

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

About Us

"It's about Microsoft Excel"