ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying between office apps ( excel & Word ) (https://www.excelbanter.com/excel-programming/288612-copying-between-office-apps-excel-word.html)

Phil

copying between office apps ( excel & Word )
 
I've done a little programing in Word & Excel VBA and am
trying to
open a word doc, select some text
Copy to clipboard , then write to Excel feild
or Copy from Excel to Word in the same way.

I normaly find code by creating a macro the examining the
results an looking up things i don't understand in the
help. but the macro dose not work when you switch apps.

chandlm[_3_]

copying between office apps ( excel & Word )
 
Hi phil,

You can use the following to do what you want. Add this macro to a
module and then select some text. Then just run the macro


Sub copytoexcel()
Selection.Copy
Set xl = CreateObject("Excel.application")
xl.Workbooks.Add
xl.Range("a1").Select
xl.ActiveSheet.Paste
xl.Application.Visible = True

Set xl = Nothing

End Sub


Phil wrote:
*I've done a little programing in Word & Excel VBA and am
trying to
open a word doc, select some text
Copy to clipboard , then write to Excel feild
or Copy from Excel to Word in the same way.

I normaly find code by creating a macro the examining the
results an looking up things i don't understand in the
help. but the macro dose not work when you switch apps. *



---
Message posted from http://www.ExcelForum.com/


No Name

copying between office apps ( excel & Word )
 
Thanks I'll Give that a go
Phil
-----Original Message-----
Hi phil,

You can use the following to do what you want. Add this

macro to a
module and then select some text. Then just run the macro


Sub copytoexcel()
Selection.Copy
Set xl = CreateObject("Excel.application")
xl.Workbooks.Add
xl.Range("a1").Select
xl.ActiveSheet.Paste
xl.Application.Visible = True

Set xl = Nothing

End Sub


Phil wrote:
*I've done a little programing in Word & Excel VBA and

am
trying to
open a word doc, select some text
Copy to clipboard , then write to Excel feild
or Copy from Excel to Word in the same way.

I normaly find code by creating a macro the examining

the
results an looking up things i don't understand in the
help. but the macro dose not work when you switch apps.

*


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com