Naming Sheet Tab as Todays Date

redneckopen

Board Regular
Joined
Nov 2, 2004
Messages
224
I would like to name each new sheet as todays date and not after a particular cell. This is what I have now;

Application.ScreenUpdating = False
Sheets("TimeList").Select
Sheets("TimeList").Copy After:=Sheets(3)
Sheets("TimeList").Select
Range("a6:g30").Select
Selection.ClearContents
Range("B6").Select
Sheets("TimeList (2)").Select
ActiveSheet.Name = Range("B3")
Sheets("TimeList").Select
Range("a6").Select
Application.ScreenUpdating = True

Thank you in advance!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try:

Code:
Application.ScreenUpdating = False
With Sheets("TimeList")
     .Copy After:=Sheets(3)
     .Range("A6:G30").ClearContents
End With
Sheets("TimeList (2)").Name = Format(Date, "mm-dd-yy")
Application.ScreenUpdating = True
 
Upvote 0
That seems to work except that it doesn't save the formula results just the formulas. I do have some formulas that are on a separate sheet. Is there some code to change the formulas to the cell values before saving to a new sheet?? Thanks.
 
Upvote 0
You could just copy the cells and paste values. Assuming you want to keep the formulas on the original sheet, just copy/paste on the *new* sheet.

Code:
Application.ScreenUpdating = False
With Sheets("TimeList")
     .Copy After:=Sheets(3)
     .Range("A6:G30").ClearContents
End With
With Sheets("TimeList (2)")
     .Cells.Copy
     .Cells.PasteSpecial xlPasteValues
     .Name = Format(Date, "mm-dd-yy")
End With
Application.ScreenUpdating = True
 
Upvote 0
I have references on a hidden sheet that when the new sheet is made the formulas must not be able to find them. Even copying doesn't work. I think I need to change them to thier values like asap utilities does. Got me, any help would be great!
 
Upvote 0
How about create a new sheet then just copy the values onto that? Not copying the sheet itself, just the values from it:

Code:
Dim wsNew As Worksheet

Application.ScreenUpdating = False

'add new worksheet
Set wsNew = Sheets.Add(after:=Sheets(3))

'copy the cells on the original sheet
Sheets("TimeList").Cells.Copy
With wsNew
    'paste to the new sheet
    With .Cells
        .PasteSpecial xlPasteValues 'paste values
        .PasteSpecial xlPasteFormats 'paste cell formats
        .PasteSpecial xlPasteColumnWidths 'paste column widths
    End With
    .Range("A6:G30").ClearContents
    .Name = Format(Date, "mm-dd-yy")
End With

Application.ScreenUpdating = True
 
Upvote 0
Running into a 'bug' with this line;

.PasteSpecial xlPasteColumnWidths 'paste column widths

?? any idea why??
 
Upvote 0
No idea at the moment, seeing as the code works for me when I run it in 2002.

What is the error displayed?
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,887
Members
449,057
Latest member
Moo4247

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