Create new sheets based on a date list on another sheet within the same workbook

WillySean

New Member
Joined
Dec 11, 2018
Messages
4
Hello Great people,

I am new to Excel VBA Macros and would like to know how to Create new sheets based on a date list on another sheet within the same workbook. I want the sheets to be named after the dates. Kindly assist with the code, like a format.

the date list is found in two worksheets named "PURCHASES" and "SALES", in range "G4: lastcell" on both worksheets. I want the newly generated sheets to be named sequentially and if any date is entered in the cells, they should be updated automatically on the worksheet names.



i need the code guide please.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Code:
Sub willy()
Dim a As Long
  For a = 4 To sheets(SALES").Cells(Rows.Count, "G").End(xlUp).Row
  Sheets.Add.Name = Cells(a, 7)
  Next a
  MsgBox "complete"
End Sub
this will create sheets but does not update as you update cells
ravi shankar
 
Upvote 0
Code:
Sub willy()
Dim a As Long
  For a = 4 To sheets(SALES").Cells(Rows.Count, "G").End(xlUp).Row
  Sheets.Add.Name = Cells(a, 7)
  Next a
  MsgBox "complete"
End Sub
this will create sheets but does not update as you update cells
ravi shankar



Thank you very much Ravi,

would you mind I send the excel document to you, so you can help look it up?

I want it to really add new sheets automatically the moment I add enter values into a new cell.
I also want it the sheets names to automatically change, the moment I alter the values in a cell that is linked to the sheet name.
 
Upvote 0
If you wish to share your workbook please upload it to a share site & post a link to it in this thread.

Please see rule#4
 
Upvote 0
That link works fine for me.
 
Upvote 0

Forum statistics

Threads
1,214,625
Messages
6,120,598
Members
448,973
Latest member
ksonnia

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