+ Reply to Thread
Results 1 to 7 of 7

vba code to select dates to print data from list

  1. #1
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    vba code to select dates to print data from list

    helo i have a worksheet with a list (tabla1) first column in list contains dates

    i need a code to select a initial and end date to print data from list (important needs to inlude Application.Dialogs(xlDialogPrinterSetup).Show to pront to select printer)

    thank you

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: vba code to select dates to print data from list

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    Re: vba code to select dates to print data from list

    test.xlsm

    i am uploading the file with the list ,
    i am looking for a vba code that filters 1st column by 2 dates start and end date and print only selected dates from list

    lets say i have 4 rows and 8 columns of list and i select 12/08/17 to 13/08/17

    12/08/17 DATA DATA DATA DATA DATA DATA DATA
    12/08/17 DATA DATA DATA DATA DATA DATA DATA
    13/08/17 DATA DATA DATA DATA DATA DATA DATA
    14/08/17 DATA DATA DATA DATA DATA DATA DATA

    only first 3 rows of list are printed because they match criteria of selected dates

    if date invalid or not match with list show error and promt again to select dates

    thank you

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: vba code to select dates to print data from list

    Why do you need a macro. Why not Date Filters, Between... from the filters dropdown in column A?
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    Re: vba code to select dates to print data from list

    i would add the code to a userfrom i have created ...

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: vba code to select dates to print data from list

    Quote Originally Posted by bluepomme View Post
    i would add the code to a userfrom i have created ...
    Surely the question is still valid though.
    Using a macro with a userform will involve just as many, maybe more keystrokes as a standard Excel Autofilter with the 'between' dates selection.

    However if you do need a macro, with the dynamic range name 'dates' which covers all the dates in a column, and two text boxes on a user form, the code to run is

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    Re: vba code to select dates to print data from list

    thank you for your answer, help and advise

+ 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. Using a drop down list to select print range
    By PatrickMinto in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-30-2018, 01:46 AM
  2. [SOLVED] Select the earliest and latest dates from a list of dates
    By Hawkmoth1 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-18-2017, 06:54 AM
  3. Select a unique value from a list and print the workbook
    By judeprem in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2016, 02:18 AM
  4. vba code to select all data in drop down and to take print
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-28-2014, 05:16 PM
  5. select mo/yr w/data validation list, insert celll entry into vba file reference code
    By ShannonHowell in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-10-2011, 04:07 AM
  6. Replies: 8
    Last Post: 03-07-2011, 01:43 PM
  7. Use list to select worksheets to print out
    By shovels in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2009, 12:10 PM

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