Autofill Worksheets

B

Bonnie

Is there a way in Excel 2000 to rename the first two
worksheets and then use an autofill type feature to add
more worksheets with a series of names? For example, name
one worksheet January, the next one February, then insert
new worksheets that would be automatically named the
consecutive months.

Bonnie
 
J

JulieD

Hi Bonnie

i would probably approach it this way,
choose tools / options / general
change "sheets in a new workbook" to 12
open a new workbook - it will have 12 sheets
go back into tools / options / general and set the sheeets back to 3
then run the following code

----
Sub namesheets()
Dim i As Date
i = DateValue("5-Jan-2005")
For Each ws In Worksheets
ws.Name = Format(i, "mmm")
i = i + 30
Next
End Sub
----
to use the code, right mouse click on a sheet tab, choose view code, in the
VBE window choose insert / module from the menu - copy & paste the code in
there, use ALT & F11 to switch back to your workbook and then choose tools /
macro / macros, find the namesheets macro and run it.

alternatively you can check out the following web page - it's an example to
create sheets based on a list


http://www.mvps.org/dmcritchie/excel/sheets.htm


Cheers

JulieD
 

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