Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2004, 05:05 AM
Authorized User
 
Join Date: Nov 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a function to add a new worksheet

I have created a vba procedure to add a new worksheet.

Private Sub AddSheet()
ActiveWorkbook.Worksheet.add
End sub

I would like to add more functionality to this procedure such as, giving a name to the new worksheet as soon as it is created. Also I would like to name the sheet using the current month and year e.g. "July 2004".
 
Old July 29th, 2004, 12:57 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = Format(Now, "mmmm yyyy")
 
Old August 16th, 2004, 01:30 PM
Authorized User
 
Join Date: Nov 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

tanx






Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Function deontae45 SQL Server 2000 2 September 25th, 2006 11:31 AM
add function to custom toolbar Vince_421 Access VBA 0 May 20th, 2006 10:36 AM
Calling Javascript Function With Attributes.Add OutCaster ASP.NET 1.0 and 1.1 Basics 1 January 27th, 2006 09:53 PM
Creating a linked table to an Excel worksheet alantodd Access VBA 3 May 30th, 2005 08:38 PM
I.H. Beg VC++ Add Member Function n6532l Visual C++ 1 September 25th, 2003 01:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.