Results 1 to 2 of 2

Create a new worksheet based on the date

Threaded View

  1. #1
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    Create a new worksheet based on the date

    Good morning everybody,

    I have this worksheet that I need to optimize. I have created a master sheet and I can create a new sheet by using this:

    "Option Explicit
    
    Sub AddMonthWkst()
    Dim ws As Worksheet
    Dim wsM As Worksheet
    Dim strName As String
    Dim bCheck As Boolean
    
    On Error Resume Next
    Set wsM = Sheets("Master")
    strName = Format(Date, "Mmm yy")
    bCheck = Len(Sheets(strName).Name) > 0
    
    If bCheck = False Then
    'add new sheet after Instructions
        wsM.Copy After:=Sheets(1)
        ActiveSheet.Name = strName
    End If
    
    Set wsM = Nothing
    End Sub"
    This works fine... but... Rows 2 (C:AF or C:AG, depending on the month, should contain the date (Mon, Tue, Wed, etc) while row 3 (C:AF or C:AG, depending on the month, should contain the date (01,02,03, etc).

    Also I need to be able to create as many sheets as I need, right now I can only create the one that concerns the current month (this is because I might need to assign next months flights ahead of time, i.e. charters).

    Is there a way that this can be achieved?

    Thank you for any help/suggestions you can give
    Last edited by s7yzrs; 11-09-2019 at 05:57 AM. Reason: tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 03-15-2017, 09:44 AM
  2. Replies: 1
    Last Post: 06-02-2014, 04:42 PM
  3. Automatically create Gmail with text, based on date entry in Excel worksheet
    By F1Fan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-17-2012, 12:17 PM
  4. [SOLVED] Create new worksheet based on a date
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2012, 11:23 AM
  5. Automatically Create & Name New Worksheet Based On Cell Value (date)
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2011, 01:55 PM
  6. Replies: 2
    Last Post: 03-14-2011, 10:13 AM
  7. Create records in a new worksheet based on data in another worksheet
    By CharlesSigmon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2010, 12:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1