Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
what would the script look like to open a new sheet
2 questions again
i got it right to give a sheet the same name as the contents of a cell, but that cell entry is a date formula and it seems that that's not acceptable...is there a way of entering the date in, say cell E1, then have the sheet name displayed as that date? what would the macro look like to duplicate an existing sheet, giving it today's date as a name - the date would be entered in a cell. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
what would the script look like to open a new sheet
this doesn't do any error checking to ensure there is a date in cell
A1. you can change the A1 to be any reference you want. Sub AddSheet() Dim newsheetname As Variant newsheetname = Year(Range("a1").Value) & "-" & Month(Range("a1").Value) & "-" & Day(Range("a1").Value) Worksheets.Add().Name = newsheetname End Sub On Jul 16, 12:32*pm, des-sa wrote: 2 questions again i got it right to give a sheet the same name as the contents of a cell, but that cell entry is a date formula and it seems that that's not acceptable...is there a way of entering the date in, say cell E1, then have the sheet name displayed as that date? what would the macro look like to duplicate an existing sheet, giving it today's date as a name - the date would be entered in a cell. * |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to mention a particular sheet name while opening excel with VB script. | New Users to Excel | |||
How to mention a particular sheet name while opening excel with VB script. | New Users to Excel | |||
simple vb script to open, | Excel Discussion (Misc queries) | |||
why, when i open a work sheet does a blank sheet open as well | Excel Discussion (Misc queries) | |||
Search open sheets in workbook and insert into open sheet | Excel Discussion (Misc queries) |