Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Create new worksheet

Hello! I have a macro that when I press a button I want it to create a new
worksheet. The name of the worksheet shall be the current date. I do not know
exactly how to write this so I would really appreciate some help. Pls help me
with this code! Thank you very much!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Create new worksheet

Hi Anne,

Try:

'=============
Public Sub Tester()
Dim SH As Worksheet

Set SH = Worksheets.Add(After:=Sheets(Sheets.Count))
SH.Name = Format(Date, "dd-mm-yy")
End Sub
'<<=============

---
Regards,
Norman


"Arne Hegefors" wrote in message
...
Hello! I have a macro that when I press a button I want it to create a new
worksheet. The name of the worksheet shall be the current date. I do not
know
exactly how to write this so I would really appreciate some help. Pls help
me
with this code! Thank you very much!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Create new worksheet

Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name = Format(Date,
"dd-mm-yy")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Arne Hegefors" wrote in message
...
Hello! I have a macro that when I press a button I want it to create a new
worksheet. The name of the worksheet shall be the current date. I do not

know
exactly how to write this so I would really appreciate some help. Pls help

me
with this code! Thank you very much!



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
Create new workbook and new worksheet and close. Worksheet not sav Patrick Djo Excel Worksheet Functions 0 July 20th 09 07:10 PM
i need to create a 2nd worksheet from my base worksheet Tracy Excel Discussion (Misc queries) 0 April 6th 09 08:17 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
Can I create a worksheet menu to select each other worksheet pippagrace Excel Discussion (Misc queries) 4 June 23rd 06 01:28 PM
Using VBA to create a new worksheet, and then target new worksheet brianproctorla Excel Discussion (Misc queries) 1 September 27th 05 12:50 AM


All times are GMT +1. The time now is 08:23 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"