+ Reply to Thread
Results 1 to 6 of 6

Problem inserting new worksheet in Excel daily time tracker w/ at specific location

  1. #1
    Registered User
    Join Date
    12-13-2014
    Location
    Minneapolis
    MS-Off Ver
    MS Office 2010 Pro 32 bit
    Posts
    23

    Problem inserting new worksheet in Excel daily time tracker w/ at specific location

    I have the following code:
    Please Login or Register  to view this content.
    My file is used for daily productivity & time tracking and is almost working as I'd like. Originally the macro would place the new sheet to the far right of all sheets in the book, but as it's iterated over the last month or so it's getting cumbersome to keep scrolling all the way to the left to the tab with my macro button ("Activities & Macro"). So, I started tinkering with a new file in which only 3 tabs to start: "Template", "Activities & Macro", and "08-05-20".

    When I run the macro a new sheet is created right after the Activities & Macro tab as I'd like (this would mitigate the need to keep scrolling left after a new day/date tab is inserted). However, then there's a break down ... Tab 08-05-20 gets renamed as 08-06-20 and the new sheet (inserted after Activities & Macro tab) is named 08-06-20 (2).

    If I run macro again I end up with: 08-07-20 (2), 08-06-20, and 08-07-20 so now what was 08-06-20 is now 08-07-20 and the new sheet is 08-07-20 (2). This would iterate perpetually with every new sheet as a duplicate. Also, once the date is set - it should be static; e.g., first date = 08-05-20, next = 08-06-20, next = 08-07-20 so on for time tracking purposes ...

    What am I missing? Thanks!
    Last edited by sschwant; 08-07-2020 at 04:42 PM. Reason: updating title

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Problem inserting new worksheet in Excel daily time tracker w/ at specific location

    So you don't want to set wshL to last worksheet. But the worksheet to right of "Activities & Macro" sheet.

    Try...
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    12-13-2014
    Location
    Minneapolis
    MS-Off Ver
    MS Office 2010 Pro 32 bit
    Posts
    23

    Re: Problem inserting new worksheet in Excel daily time tracker w/ at specific location

    Quote Originally Posted by CK76 View Post
    So you don't want to set wshL to last worksheet. But the worksheet to right of "Activities & Macro" sheet.

    Try...
    Please Login or Register  to view this content.
    thanks for the reply CK76! Unfortunately this script breaks at d = DateValue(wshL.Name) due to run type error '13' type mis-match ... any idea why or how to fix ?

    regards,
    Steve (sschwant)

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Problem inserting new worksheet in Excel daily time tracker w/ at specific location

    That means wshL.Name isn't in format that can be converted using Datevalue.

  5. #5
    Registered User
    Join Date
    12-13-2014
    Location
    Minneapolis
    MS-Off Ver
    MS Office 2010 Pro 32 bit
    Posts
    23

    Re: Problem inserting new worksheet in Excel daily time tracker w/ at specific location

    is there a fix or work around for the value/format problem ?

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Problem inserting new worksheet in Excel daily time tracker w/ at specific location

    Use Debug.Print or other means to see what wshL. Name is. Then either rename the sheet or change sheet order. If you cannot fix, upload sample workbook.

+ 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. Replies: 1
    Last Post: 03-11-2020, 04:17 PM
  2. How to send excel file automatically through outlook on specific time daily.
    By ashok155 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-25-2014, 09:08 AM
  3. [SOLVED] Inserting a date in a specific format into a cell
    By Bezzie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2014, 03:32 AM
  4. [SOLVED] Inserting daily quote based today date
    By vickicr888 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2013, 12:56 PM
  5. Need Excel daily Task tracker template
    By fzzd2x in forum Excel General
    Replies: 0
    Last Post: 09-26-2012, 09:37 AM
  6. [Excel 2010] Daily summary from date+time values
    By duration in forum Excel General
    Replies: 11
    Last Post: 08-02-2010, 05:52 AM
  7. time tracker-a running tracker date wise
    By arnab0711 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-18-2008, 03:08 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