Help - Creating Worksheets

ectoid

Board Regular
Joined
Jan 18, 2005
Messages
97
I am writing a macro to create multiple worksheets based on a column of values. While I can get the macro to create and name a worksheet based on a specified cell I can't figure out how to do it iteratively down the complete list. I'm not sure if I'm suppose to use a Do...Loop with Offset ranges or what.
Any suggestions would be much appreciated. Thanks, Eric.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Assuming your list is consecutive down column A, starting in Cell A2.
Code:
Sub tt()
Dim c As Range

Set c = Sheets(1).Range("A2")

Do While c.Value <> ""
    Sheets.Add after:=Sheets(Sheets.Count)
    ActiveSheet.Name = c.Value
    Set c = c.Offset(1, 0)
Loop

End Sub
HTH
 
Upvote 0
Duuuuudddeeee!!
See, I knew there was a Loop and an Offset!
****, you got that back fast...I've only been working with this stuff for a couple days and I thank you greatly!!
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,593
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top