modifing code

kemperohlmeyer

Board Regular
Joined
Oct 4, 2006
Messages
73
Can someone please help me modify this code (below) so that it exports each sheet within the workbook as an html file. The code i am attaching works fine, but only exports ranges from a pre-defined list. I need it to just go sheet by sheet and publish as a webpage.

Thanks,
ko

Sub SaveAsWebPage()
' A macro that saves the pre-defined area as a webpage
' Created by Kemper Ohlmeyer

For Each c In Range("List4")
Range("A3").Value = c.Value
Calculate
Set FileName = Range("d1")
Range("A1:T44").Select
With ActiveWorkbook.PublishObjects("08 - Snapshot info - current managers_7205")
.HtmlType = xlHtmlStatic
.FileName = FileName
.Publish (True)
.AutoRepublish = True
End With
ChDir "P:\Portfolio Mgmt - Due Diligence\WG new\Coded Spreadsheet Templates\Snapshot"
Next c
End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,140,940
Messages
5,703,285
Members
421,289
Latest member
fbohlandt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top