Hi! I'm working on a program in VBA that requires copying and pasting from Excel to Notepad, and I could use a little help.
In another method in the same worksheet, a program automatically generates the contents of a sheet, x amount of cells at a time (it's not fixed, it's based on user input). What I want to do is:
1) Copy the selection that just got added to the randomly generated sheet
2) Open Notepad
3) Paste contents into Notepad
4) Save file as the date in the format "ddmmyyyy" + " PROG", so for instance today it would be like "15062015 PROG". Also it needs to be saved in the format .csv. Thanks!!
What I was thinking so far was along the following lines:
But this doesn't really allow me to automatically generate the name or anything.
In another method in the same worksheet, a program automatically generates the contents of a sheet, x amount of cells at a time (it's not fixed, it's based on user input). What I want to do is:
1) Copy the selection that just got added to the randomly generated sheet
2) Open Notepad
3) Paste contents into Notepad
4) Save file as the date in the format "ddmmyyyy" + " PROG", so for instance today it would be like "15062015 PROG". Also it needs to be saved in the format .csv. Thanks!!
What I was thinking so far was along the following lines:
Code:
Sub CopytoNotepad()
Range(Cells(1,1),Cells(1,x)).Copy
Shell "Notepad.exe", vbNormalFocus
Sendkeys "^V"
EndSub
But this doesn't really allow me to automatically generate the name or anything.