Shell command to post to notepad

M

Mbt6

I want to paste some information to note pad from excel

in vba I do something like

Range("c2").Select
Range(Selection, Selection.End(xlDown)).Copy
Shell("notepad.exe")


I need something in the Shell command to make the notepad window active, and
be able to paste to it. Any ideas?

--thanks --mike
 
B

Bob Phillips

Here is a particularly nasty example

Shell "Notepad.exe", 1
DoEvents
Application.SendKeys "ABC" & Chr(13), True
Application.SendKeys "XYZ", True
AppActivate Application.Caption

but would it not be better to just write to a text file directly?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
B

Bob Phillips

BTW, paste would be

Sub Tester3()
Range(Range("c2"), Range("c2").End(xlDown)).Copy
Shell "Notepad.exe", 1
DoEvents
Application.SendKeys "^v", True
AppActivate Application.Caption
End Sub




--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
R

R.VENKATARAMAN

Is there a similar shell command from webpage (copy one or two items from a
table in the webpage )
to excel
I know how to get a table from webpage.using web query.
Or can this be only from excel to another microsoft office item.
thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top