Save as .htm with filename from cell

  • Thread starter Thread starter agentcooter
  • Start date Start date
A

agentcooter

I have a macro to save a sheet as an htm file. I can specify a name
for the file. Is there a way to use the contents of a cell for the
file name? Thanks for any and all help.
 
As long as the values in the cell do not contain forbidden characters, you
could simply reference the cell when saving the file using
range("cell_containing_name").value
 
What about publishing just one sheet as an htm file. My macro looks
like this now. I used Record Macro to get it. I don't know what all
those words mean in the macro. But I would like to be able to use the
contents of cell N131 as the filename. Thanks.
 
Change the following line

"C:\Documents and Settings\HP_Administrator\Desktop\Copy of
cooter\calhDATE.htm", "web (2)", "", xlHtmlStatic, "horses_17286", "")

"C:\Documents and Settings\HP_Administrator\Desktop\Copy of cooter\" &
range("N131").value, "web (2)", "", xlHtmlStatic, "horses_17286", "")
 

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

Back
Top