ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA coding to export multiple calcualtion sheets as webpages (https://www.excelbanter.com/excel-programming/374338-vba-coding-export-multiple-calcualtion-sheets-webpages.html)

[email protected]

VBA coding to export multiple calcualtion sheets as webpages
 
I have created a very simple code that right now runs through a
list of references, pulls the relevant information into our template
(ie, calculate) and prints. I need to revise (overhaul) the code so
that it does a similar task but now saves each calcualtion as a web
page named for the reference and the date it was exported. Can someone
please help me get a shell going?

Thanks,
ko

(my uber-simple code is below, it won't help probably)

Sub PRINT_ALL()
For Each c In Range("List4")
Range("A3").Value = c.Value
Calculate
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Next c
End Sub


fugazi48

VBA coding to export multiple calcualtion sheets as webpages
 
I am not sure when to put it in your loop but the following code grabs the
text from "a1" and sticks it into a string with the Month and Day all
separated with Underscores, and saves it as month_day_reference.html

I used underscores because filenames don't work well with slashes common in
dates.

Dim c_date
Range("a1").Select

c_date = Month(Now) & "_" & Day(Now) & "_ " & Selection.Formula

ActiveWorkbook.SaveAs Filename:= _
c_date, FileFormat:=xlHtml _
, ReadOnlyRecommended:=False, CreateBackup:=False


" wrote:

I have created a very simple code that right now runs through a
list of references, pulls the relevant information into our template
(ie, calculate) and prints. I need to revise (overhaul) the code so
that it does a similar task but now saves each calcualtion as a web
page named for the reference and the date it was exported. Can someone
please help me get a shell going?

Thanks,
ko

(my uber-simple code is below, it won't help probably)

Sub PRINT_ALL()
For Each c In Range("List4")
Range("A3").Value = c.Value
Calculate
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
Next c
End Sub




All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com