+ Reply to Thread
Results 1 to 2 of 2

Auto Add/Remove rows for dates each month

  1. #1
    Registered User
    Join Date
    08-13-2021
    Location
    Hokkaido, Japan
    MS-Off Ver
    2010
    Posts
    1

    Auto Add/Remove rows for dates each month

    Hi,
    I have a spreadsheet to track energy usage each day, which calculates totals, averages, costs, etc. The daily data usage is pulled from another spreadsheet.
    I am looking for a way to duplicate the sheet for a new month which will update the number of days depending on what the month is. For example, June has 30 days so the data is in rows 10 - 39 with totals in row 40. When I duplicate the sheet for July (31 days) I need to add a row for 31st before the totals row and update formulas to include the additional row.
    Is there a way to get this to happen automatically using a macro?

    Thanks.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: Auto Add/Remove rows for dates each month

    You could put the totals above row 10 and refer to the full range (i.e. for a 31-day month). You can apply conditional formatting for the final few days (i.e. for 29th onwards, to account for February) which will blank out the date if the month of that date is not the same as the month in row 10. This will happen automatically.

    Hope this helps.

    Pete

+ 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: 10
    Last Post: 11-11-2014, 09:39 AM
  2. Help to create Macro to Auto-fill end of month based on given start and end dates
    By patidallas22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2014, 11:26 AM
  3. VBA in change event format to auto remove rows having zero value and auto sort
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-06-2013, 09:18 AM
  4. Replies: 2
    Last Post: 07-31-2013, 02:00 PM
  5. [SOLVED] Auto populate dates of a month based on dropdown selection
    By tstruntz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2012, 10:10 AM
  6. How to remove all the rows which doesnt belong to the current month
    By raghunaik in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2009, 11:46 AM
  7. Auto Format spreadsheet with various rows month to month
    By sratkins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2009, 01:07 AM

Tags for this Thread

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