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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

martinee

Well-known Member
Joined
Nov 4, 2003
Messages
960
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
 

ectoid

Board Regular
Joined
Jan 18, 2005
Messages
97
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!!
 

Forum statistics

Threads
1,147,694
Messages
5,742,671
Members
423,746
Latest member
Joaogomes

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
Top