Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
E
I forgot to rename the sheet. See code below for change Sub MakeSheets() Dim cell As Range Dim Rng As Range Dim wsh As Worksheet Set Rng = Sheet1.Range("a2", Sheet1.Range("A2").End(xlDown)) 'Loop through cells For Each cell In Rng.Cells 'Create new sheet Set wsh = ThisWorkbook.Worksheets.Add(, _ ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)) 'Copy header row cell.Offset(-cell.Row + 1, 0).Resize(, 7).Copy _ wsh.Range("a1") 'Copy data row cell.Resize(, 7).Copy _ wsh.Range("A65536").End(xlUp).Offset(1, 0) On Error Resume Next wsh.Name = wsh.Range("A2").Value On Error Goto 0 Next cell End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Copy Worksheet Name into worksheet A1 | Excel Worksheet Functions | |||
VB Macro to Copy from Worksheet | Excel Discussion (Misc queries) | |||
Macro to copy worksheet | Excel Discussion (Misc queries) | |||
I need help with a macro which will copy a worksheet and.. | Excel Worksheet Functions | |||
Copy from worksheet to worksheet with Macro | Excel Programming |