LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default create new sheets from a header row

I'm trying to take a sheet of compiled data and create several sheets
of individual data. The headers are in column A, so i'm trying to
create a new sheet in the workbood for each value of column A. It
keeps bombing out at different points, depending on what i try, here's
what i have so far, the values in colum A start at A6, it's flagging
For Each C In MyRange right now, any ideas?

Sub NewSheet()
Dim MyRange As Range
Dim C As Range
Dim NewSheetName As String
Range("A6").Select
ActiveCell.End(xlDown).Select
xLastRow = ActiveCell.Row
Range("A6" & xLastRow).Name = "MyRange"

For Each C In MyRange
Range("A" & MyRange).Name = "C"
C.Select
NewSheetName = Selection.Value
Sheets.Add Type:="Worksheet"
With ActiveSheet
.Move After:=Worksheets(Worksheets.Count)
.Name = NewSheetName
End With
Next C

End Sub

 
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
Grouping sheets copies Header across to all sheets James Trujillo[_2_] Excel Worksheet Functions 1 December 7th 09 08:16 PM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
Header repeat across Sheets? jenny28 Excel Discussion (Misc queries) 1 February 1st 06 01:15 AM
xls header all sheets BullvBear Excel Discussion (Misc queries) 1 September 15th 05 07:54 PM
How to set footer and header for all sheets? Kurt Remlin Excel Programming 2 May 1st 04 07:10 AM


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

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"