Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Script to Open Text File, Paste Data from Excel

Status
Not open for further replies.

useractive

Programmer
Jun 21, 2001
98
0
0
US
I'm looking for a script that when ran from excel, it will open notepad, and then paste in the data that was copied from the excel document.

Is this possible through an excel macro?

Thanks,
Swish
 
I'm sure it's possible to do it the way you describe but I don't know the code for that - may I suggest that, you copy the data to a new workbook and save that as a textfile:

Workbooks.add
Range("A1").select
Selection.paste
activeworkbook.saveas "Full Path and Name.txt"
activeworkbook.close savechanges:=false

should accomplish what you want....

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
This is crude but it does copy the selection to the Clipboard and start Notepad. You can do what you like there, and then return to Excel.

Sub CopyToNotePad()
Dim RetVal
Selection.Copy
RetVal = Shell("C:\WINDOWS\NOTEPAD.EXE", 1)
MsgBox "Returned to Excel"
Application.CutCopyMode = False
Range("A1").Select
End Sub


Barborne
Worcester
UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top