Is there a way to copy and paste the date into worksheets

  • Thread starter Thread starter mark_vi_
  • Start date Start date
M

mark_vi_

Is there a way to copy and paste dates into the worksheet withou
individually typing up each one
 
Is there a way to insert it the date into the the worksheet tab (not th
cells in the actual worksheet but the name of the worksheet itself
 
Hold down Ctrl key and press semicolon

Ctrl-Shift colon will give the time

Vaya con Dios,
Chuck, CABGx3
 
Mark

VBA only.

Sub sheetname()
ActiveSheet.Name = Format(Now(), "dddd-mmm-yy")
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben Excel MVP
 
Thanks for the macro tip.

But now let's say hypothetically I am starting back in September 200
and I want to add the dates (September 1, 2004 - June 23, 2004
day-by-day to the tab. The macro you proposed is only for today's date
Is there a macro that can be used so when I type in September 1, 2004 t
the tab the next sheet will read September 2, 2004 and the next on
September 3, 2004 and etc...? In other words is there a macro whic
increases the dates incrementally
 
Try this macro

I assume that first sheetname name to be september 2,2004 , you can
edit it by changing dtdate variable value


Sub macro()
Dim init As Variant
Dim dtdate As Date
dtdate = "September 2, 2004"
init = 0
For Each w In Worksheets
w.Select
If init = 0 Then
init = 1
ActiveSheet.Name = Format(dtdate, "mmmm d, yyyy")
Else
dtdate = DateAdd("d", 1, dtdate)
ActiveSheet.Name = Format(dtdate, "mmmm d, yyyy")
End If
Next
End Sub
 
Back
Top