Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 208
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mention a particular sheet name while opening excel with VB script. refina New Users to Excel 1 June 17th 08 02:32 AM
How to mention a particular sheet name while opening excel with VB script. refina New Users to Excel 2 June 16th 08 10:50 AM
simple vb script to open, refina Excel Discussion (Misc queries) 0 June 14th 08 07:37 PM
why, when i open a work sheet does a blank sheet open as well John Excel Discussion (Misc queries) 2 July 7th 07 06:20 PM
Search open sheets in workbook and insert into open sheet punx77 Excel Discussion (Misc queries) 0 March 6th 06 05:07 PM


All times are GMT +1. The time now is 04:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"