Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default specify each sheet name when saving workbook as html

Hello experts. I need to break up my workbook into separate files for
each sheet. The plan is to save it as HTML (which produces an html
file for each sheet). When saving my excel workbook as html, I would
like to specify the name of each sheet. Right now when you save a
workbook it automatically names each sheet (sheet001.htm,
sheet002.htm, etc.) even when they are explicitly named in the
workbook. How can I specify these names?

Alternatively can I break up the excel workbook into a different
workbook for each sheet? Again, I want to specify the file name.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default specify each sheet name when saving workbook as html

To save each sheet as a new *.html file using the current sheet names.

Sub Make_New_Books()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWorkbook.Worksheets
w.Copy
ActiveWorkbook.SaveAs FileName:=ThisWorkbook.Path & _
"\" & w.Name, FileFormat:= xlHtml
ActiveWorkbook.Close
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

If you mean from a list of names on a sheet use this to first change the sheet
names in your original workbook.

Sub NameWS()
're-name 10 sheets with list in A1:A10 on first sheet
'make sure your list range has enough names to cover the number of sheets
On Error Resume Next
For i = 1 To Worksheets.Count
Sheets(i).Name = Sheets(1).Cells(i, 1).Value
Next i
End Sub

The Make_New_Books macro will close the original workbook and not ask to save
changes.


Gord Dibben MS Excel MVP


On 5 May 2007 12:03:10 -0700, wrote:

Hello experts. I need to break up my workbook into separate files for
each sheet. The plan is to save it as HTML (which produces an html
file for each sheet). When saving my excel workbook as html, I would
like to specify the name of each sheet. Right now when you save a
workbook it automatically names each sheet (sheet001.htm,
sheet002.htm, etc.) even when they are explicitly named in the
workbook. How can I specify these names?

Alternatively can I break up the excel workbook into a different
workbook for each sheet? Again, I want to specify the file name.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default specify each sheet name when saving workbook as html

that kicked ass! thanks :) !

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default specify each sheet name when saving workbook as html

Thanks for the feedback.

Gord

On 6 May 2007 20:23:37 -0700, wrote:

that kicked ass! thanks :) !


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hyperlink tospecific sheet of html workbook dejaveu93 Excel Worksheet Functions 0 June 29th 06 04:13 PM
hyperlink to sheet in workbook saved as html Y Sbuty Excel Discussion (Misc queries) 0 March 26th 06 11:54 PM
Saving one sheet within a workbook David Vollmer Excel Discussion (Misc queries) 2 September 14th 05 06:04 PM
Weekly Email one sheet in workbook not saving contacts Brian Mashburn Excel Worksheet Functions 0 January 27th 05 07:19 PM
Hyperlink to specific sheet; workbook saved as html Bawn Excel Worksheet Functions 0 January 5th 05 01:31 PM


All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"