+ Reply to Thread
Results 1 to 14 of 14

Filtering data and posting results to another sheet

  1. #1
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Filtering data and posting results to another sheet

    I would like a macro asking for “beginning” and “ending” dates, then asking for “Car Make”

    Based on the result, on sheet2, starting on cell B6, show the result, which would include: the Make, Date, Region No, S or H, and the number sold, along with the total, but not to show zero or empty cells.

    Allow the user to edit sheet2 (highlight, comment) print it, clear contents, etc.

    Can any such macro, then retain the dates (until the workbook is closed), so if the macro is called again, it would ask “In the same period, what Make would you like to report on” and then repeat the process.
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering data and posting results to another sheet

    Hi kjg

    The Code in the attached appears to do as you require. Please note this Code in the Workbook Open Event.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Filtering data and posting results to another sheet

    Hi Jaslake,

    Thanks for the code.

    I press the "Make Selection" button and choose a start date and end date then model, when I press the "Extract Data" button, I get a dialog box asking again for Start Date. If I repeat the process, I get the same dialog.

    What do you think??

    Keith

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering data and posting results to another sheet

    Hi Keith

    You get that on your Sample File???

  5. #5
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Filtering data and posting results to another sheet

    Hi Again,

    Yea /no, I get it on the data / file you sent back to me, downloaded and saved.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering data and posting results to another sheet

    Hi Keith

    Well, I don't know what to think. Tested the Code in both Excel 2007 and 2010. Runs just fine on my platform.

    I want you to put a Break Point at the line of Code as indicated. Then click the Make Selection Button. When you see the VBA screen step through the Code (F8). Tell me what's it's doing. I cannot duplicate the error.
    Attached Images Attached Images

  7. #7
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Filtering data and posting results to another sheet

    Good Morning,

    I did as you suggested and placed a breakpoint on the "With Me" line and pressed the button, I then pressed the F8 key and stepped through the code. The code goes through the MsgBox and then displays the message "Please enter a Start Date".

    If I REM that block of code it does the same again for the end date "Please enter a End Date", if I REM that bit of code also it runs fine, suggesting that the date is the problem.

    Please Login or Register  to view this content.
    I noticed that although I select, say, 15/01/2014 the dialog would display 1/15/2014. Not knowing what I am doing, I changed the below code from

    Please Login or Register  to view this content.
    TO

    Please Login or Register  to view this content.
    This displayed my selection correctly but then I get a dialog "No cells were found"

    Regards,
    Keith

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering data and posting results to another sheet

    Hi Keith

    I really have no clue unless it's related to the Regional Setting. What is yours?

  9. #9
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Filtering data and posting results to another sheet

    My Regional Setting are English UK

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering data and posting results to another sheet

    Hi Keith

    After changing my Regional Settings I'm having issues...need to play with it for a bit...see what, if anything I can do. I'm not familiar with this issue but I will be

  11. #11
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Filtering data and posting results to another sheet

    Thank s very much.......I await the outcome. Also, is there any chance that you could add some comments to your code as I'd like to "try" and understand it a little and try to learn from it.

    Cheers,
    Keith

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering data and posting results to another sheet

    Hi Keith

    The Code in the attached "appears to work" with Regional Settings of English UK on my platform.

    I've annotated the Code.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Filtering data and posting results to another sheet

    I have done some testing and it seems to be working perfectly and as I required. Thank you for your time and effort, I do appreciate it. Thank you also for the annotation, I will study it but it still looks like a "foreign language" to me.

  14. #14
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filtering data and posting results to another sheet

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. [SOLVED] Filtering Data and copying only filtered results
    By bigfishprf in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-07-2013, 07:51 AM
  2. Filtering data from the results of a sumifs formula
    By marks_28 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-27-2013, 11:55 AM
  3. Filtering Results and Copying Each Result to a Seperate Sheet
    By gjaylward2008 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2012, 04:10 PM
  4. As user fills out data sheet, then fill out a results sheet based on data sheet entry
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-13-2012, 03:57 PM
  5. filtering data from multi sheets then performing functions on results
    By jrtaylor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2009, 03:54 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