opening and writing into notepad

P

peter

hey all,

first time i'm ever trying to do something like this, and
i'm stuck. i know how to open up notepad through vba, but
not much else.

what i've got so far is this:

******
Private Sub CommandButton1_Click()

FormatInfo 'function to format cells in spreadsheet
ReturnValue = Shell("notepad.exe", 1)
CreateHTML 'write text into notepad

End Sub
******

basically, i want to create a html file after information
is pasted into a spreadsheet.


my questions are these:
1). how do i actually write into notepad, given if i have
a set html code, and only a few things will change?
2). those parts that will change for each new html file
are cell values in the spreadsheet. so this macro
basically makes html files much easier than copying and
pasting info over and over again for each new group of
info.

and then, ultimately, i want to save and close notepad,
and save it like "blah.html", if "blah" was in cell A3.

so, again, a bunch of the code is exactly the same. just
little parts change, which is why i wanted this macro to
work.


tia.
 

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