Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Formatting Several Sheets

I have one sheet that serves as an menu to name several new sheets in
my workbook. I would like to add to this code. I need Range("a3") on
each NEW worksheet to contain a heading from the same list. It would
say, "Regional Office 325 2008". The "325" for the header would come
from the sheet.name. Any ideas?

Sub copyCleanTemp()
Dim rngName As Range
Dim i As Integer
Set rngName = ThisWorkbook.Sheets("RegDivList").Range("e2")
Do Until rngName.Value = ""
i = ThisWorkbook.Sheets.Count
Sheets("CleanTemp").Copy After:=Sheets(i)
ThisWorkbook.Sheets(i + 1).name = rngName.Value
Set rngName = rngName.Offset(1)
Loop

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Formatting Several Sheets

Suggest a shorter name

Sub copytemp()
mc = "e"
With Sheets("sheet1")
For i = 2 To .Cells(Rows.Count, mc).End(xlUp).Row
Sheets("CleanTemp").Copy After:=Sheets(i)
myname = "RegOff " & .Cells(i, mc) & " 08"
with ActiveSheet
.Name = myname
.Cells(1, 1) = myname
end with
Next i
End With
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jim" wrote in message
...
I have one sheet that serves as an menu to name several new sheets in
my workbook. I would like to add to this code. I need Range("a3") on
each NEW worksheet to contain a heading from the same list. It would
say, "Regional Office 325 2008". The "325" for the header would come
from the sheet.name. Any ideas?

Sub copyCleanTemp()
Dim rngName As Range
Dim i As Integer
Set rngName = ThisWorkbook.Sheets("RegDivList").Range("e2")
Do Until rngName.Value = ""
i = ThisWorkbook.Sheets.Count
Sheets("CleanTemp").Copy After:=Sheets(i)
ThisWorkbook.Sheets(i + 1).name = rngName.Value
Set rngName = rngName.Offset(1)
Loop

End Sub


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
Conditional Formatting In and Across Sheets KHW Excel Discussion (Misc queries) 0 May 27th 10 09:53 PM
formatting sheets in a workbook SM_NCSW Excel Worksheet Functions 4 November 6th 08 10:03 PM
formatting sheets P. Zicari Excel Discussion (Misc queries) 1 March 22nd 07 05:31 PM
Conditional Formatting In and Across Sheets jkl Excel Discussion (Misc queries) 5 February 13th 07 11:36 PM
Formatting sheets C Tate Excel Discussion (Misc queries) 2 November 27th 04 03:57 PM


All times are GMT +1. The time now is 05:28 PM.

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

About Us

"It's about Microsoft Excel"