+ Reply to Thread
Results 1 to 14 of 14

Select dates before today

  1. #1
    Registered User
    Join Date
    07-19-2017
    Location
    Zambia
    MS-Off Ver
    2010
    Posts
    37

    Select dates before today

    Hi all,

    I have a workbook with many Pivot tables in it. (PivotTable1, PivotTable2, and PivotTable3)

    The Row label has the dates with sales in the values area.

    Please can you design me a MACRO that selects all dates before today's date

    Your assistance will be highly appreciated

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Select dates before today

    Is there not a filter in the Pivot table that does this for you?

  3. #3
    Registered User
    Join Date
    07-19-2017
    Location
    Zambia
    MS-Off Ver
    2010
    Posts
    37

    Re: Select dates before today

    Hi Dave,

    This is part of a workbook with 10 pivot tables in it. I have to submit this report every morning :-(

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,870

    Re: Select dates before today

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    07-19-2017
    Location
    Zambia
    MS-Off Ver
    2010
    Posts
    37

    Re: Select dates before today

    Hi Alan,

    Could you please give me your email address because the website seems to have a problem when attaching the file

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,870

    Re: Select dates before today

    I have just tested the upload functionality of the site and it works perfectly. Did you follow my instructions for uploading files? We want all files loaded to the site and not emailed as that prevents others from getting the benefit of the solution or the opportunity to help.

  7. #7
    Registered User
    Join Date
    07-19-2017
    Location
    Zambia
    MS-Off Ver
    2010
    Posts
    37

    Re: Select dates before today

    Hi Alan,

    It keeps on failing and this is the message I keep on getting an error message.


    Pivot.PNG

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,870

    Re: Select dates before today

    There is a file size limitation of 1000kb. Is your file bigger? If so, shrink it. We only need a representative sample. Not the entire file.

  9. #9
    Registered User
    Join Date
    07-19-2017
    Location
    Zambia
    MS-Off Ver
    2010
    Posts
    37

    Re: Select dates before today

    Hi all,

    I have finally managed the to downsize the attachment.

    There are 2 worksheets (before sheet) where all the dates are selected and (after sheet) where today's date is un-selected but all the previous dates are selected.

    Please assist me with a Macro to do this because there are multiple pivot tables and I have to send this report every morning
    Attached Files Attached Files

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Select dates before today

    See if this works,
    Please Login or Register  to view this content.

  11. #11
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Select dates before today

    Hi

    It looks as though you are querying external data, so why not simply amend the SQL query with a WHERE clause to only return dates prior to today?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  12. #12
    Registered User
    Join Date
    07-19-2017
    Location
    Zambia
    MS-Off Ver
    2010
    Posts
    37

    Re: Select dates before today

    I get an error messages. Please see attached
    Attached Images Attached Images

  13. #13
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Select dates before today

    I am not sure, I tested it again and it worked okay for me.

  14. #14
    Registered User
    Join Date
    07-19-2017
    Location
    Zambia
    MS-Off Ver
    2010
    Posts
    37

    Re: Select dates before today

    Hi Xlnitwit,

    I have done that and it has worked. Thank you all

    Regards,

+ 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: 2
    Last Post: 06-25-2014, 05:59 AM
  2. [SOLVED] VBA code to select today() onwards from filter
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-18-2014, 06:39 AM
  3. [SOLVED] Conditional Formatting of: dates within 1 month and dates before today.
    By Luke Smith in forum Excel General
    Replies: 5
    Last Post: 06-18-2013, 07:29 AM
  4. [SOLVED] Counting Tasks With Due Dates between TODAY and TODAY+7
    By Erik_with_a_K in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-29-2013, 09:00 AM
  5. Macro to select today's date
    By bf0109 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-27-2012, 04:56 PM
  6. Select Cell Based on Today's Date?
    By EinGutesBier in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2008, 03:57 PM
  7. Select cell = today()
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2006, 09:30 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