Macro to identify & name tabs based on data in spreadsheet

tcnt9176

Board Regular
Joined
Jun 23, 2008
Messages
223
Here is my challenge. I am trying to build a macro that will take data and separate it on different tabs based on the date column. It may be the last 6, 12, or even 18 months depending on what the spreadsheet has. I need the macro to determine the names of the separate tabs that would just be the month and basically have a count of different things based on the date. I hope that makes sense. Any ideas? Thanks for your help!!:confused:
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi tcnt9176,

I'll atempt to asist you with this.

Is it possible for you to copy and paste into your post an example of your data.

If not, how many columns of data do you have, and which is the date column.

Is your original data all on one sheet, and are the rest of the sheets in the WB currently blanks.

Regards

ColinKj
 
Upvote 0
Thanks ColinKj. I was actually able to come up with a way to name the separate tabs appropriately. I 1st made a pivot table to determine how many and what the names of the tabs should be and then used this script. My only problem now is that it errors out after it gets to the end of my list. It adds 1 additional sheet (that I do not need) and then gives me run-time error '1004' b/c my list has ended and it doesn't know what to name it. Do you or anyone know how to stop this after the last populated cell in my list? Thanks!!!


For Each c In Sheets("Sheet1").Range("A1:A24")
Sheets.Add
ActiveSheet.Name = Right(c.Value, 30)
Next c
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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