+ Reply to Thread
Results 1 to 3 of 3

Help for Excel Macro code (copy or move yesterday's tab to new one with today's date)

  1. #1
    Registered User
    Join Date
    10-31-2014
    Location
    canada
    MS-Off Ver
    2007
    Posts
    64

    Help for Excel Macro code (copy or move yesterday's tab to new one with today's date)

    Hi;

    I want to create an Excel Macro code that copy or move worksheet with yesterday's date to a new worksheet within the same workbook and name it as today's date. For example, yesterday's tab name is Nov 17, and when new tab is created, its name should be Nov 18. so when I run the macro everyday, it always goes like this except weekend.

    I appreciate if anyone can help.

    Chris

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Help for Excel Macro code (copy or move yesterday's tab to new one with today's date)

    It can be done. Have you tried recording this action? that will give you the template to work with all it is left to do is to name the tabs correctly by checking against the last days of the month and weekends.

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Help for Excel Macro code (copy or move yesterday's tab to new one with today's date)

    Perhaps a macro like this then?

    Please Login or Register  to view this content.
    As I assume you don't run this macro on Saturday or Sunday the is no checking on weekday name. Also the Scandinavian date system is a bit different from yours in regard of the order months and date are placed so if you don't get the right date formate i.e. "now 18" you could try to change the sName setting to
    Please Login or Register  to view this content.
    .

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro To Search For Yesterday's Date And Copy Data Until No Data
    By scarlettw123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-25-2015, 06:13 AM
  2. reference column date (yesterday) to get Month(Date) for copy paste
    By jukabub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2013, 03:52 AM
  3. [SOLVED] Macro worked yesterday but not today?
    By Crawfinator1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-18-2013, 07:31 AM
  4. Created a userform in VBA that worked beautifully yesterday and crashed Excel today!
    By willneal in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 10-31-2012, 11:47 AM
  5. [SOLVED] Copy rows where date is equal TODAY and move them to another workbook
    By testingandroid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2012, 03:51 AM
  6. Code Worked Yesterday, Won't Work Today
    By mgaworecki in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-25-2009, 06:25 PM
  7. Yesterday macro worked, today it doesn't?
    By Nickster64 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2008, 12:47 PM

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