Macro as make a copy to a new sheet and rename it

Navy36

New Member
Joined
Oct 9, 2021
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi
I looking for help with macro. I want a macro as make a knew sheet and rename it to current date and the knew sheet must make a copy of a master sheet.

Maybe my code is a good start?

Sub AddSheets_TodayDate()
Dim szTodayDate As String
szTodayDate = Format(Date, "mmm-dd-yyyy")
On Error GoTo MakeSheet
Sheets(szTodayDate).Activate
Exit Sub
MakeSheet:
Sheets.Add , Worksheets(Worksheets.Count)
ActiveSheet.Name = szTodayDate
End Sub

I need help ;-)
 
Like what is the name of the sheet your copying. "Master"

And how am I suppose to know what the current date sheet is?
If you run the macro on same day it will be same date
Is the current date sheet the one your copying? NO, every time should a new copy be from "Master"

I know, my english is not the best and ihope you will understand me
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Did not understand you wanted my script to do exactly like your script does.
If that's the case what is wrong with your script?
The issues about my script is that not make a new copy of a another sheet("Master")
Where in your orginal script does it say "Master"
 
Upvote 0
Did not understand you wanted my script to do exactly like your script does.
If that's the case what is wrong with your script?

Where in your orginal script does it say "Master"
It doesnt.... But i want it

What i want is a first sheet with a button. and when you push on the button i will make a new sheet and rename it do current day and i will also have a form white some questions there i could fill in the form. If you push the buttom same day should only the current date sheet show up so i can read it or fill in more information in it
 
Upvote 0
Now your asking for:
and i will also have a form white some questions there i could fill in the form. If you push the buttom same day should only the current date sheet show up so i can read it or fill in more information in it

This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.
 
Upvote 0
Now your asking for:
and i will also have a form white some questions there i could fill in the form. If you push the buttom same day should only the current date sheet show up so i can read it or fill in more information in it

This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.
I thank you for your help

And hope someone else can help me ;-)
 
Upvote 0
How about
VBA Code:
Sub Navy()
   Dim ShtName As String
   
   ShtName = Format(Date, "mmm-dd-yyyy")
   If Evaluate("isref('" & ShtName & "'!A1)") Then
      Sheets(ShtName).Activate
   Else
      Sheets("Master").Copy , Sheets(Sheets.Count)
      ActiveSheet.Name = ShtName
   End If
End Sub
 
Upvote 0
How about
VBA Code:
Sub Navy()
   Dim ShtName As String
  
   ShtName = Format(Date, "mmm-dd-yyyy")
   If Evaluate("isref('" & ShtName & "'!A1)") Then
      Sheets(ShtName).Activate
   Else
      Sheets("Master").Copy , Sheets(Sheets.Count)
      ActiveSheet.Name = ShtName
   End If
End Sub
I think you solved my problem, but i need try it a couple of days.
Thank you :)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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