+ Reply to Thread
Results 1 to 9 of 9

Macro to display rows on separate sheets based on condition

  1. #1
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Macro to display rows on separate sheets based on condition

    Hello,
    Im working with a workbook to keep track of customer returns. I have attached my draft sheet. The sheet "Return Log" is where i want to enter data on a continual basis. I want the returns with the status "open" to be displayed on the sheet "open returns" and vice versa. I want all info in the "return sheet" to stay there, so i would only want it copied from one sheet to the other. The workbook would also have to be self updating, as a return on the "return log" sheet could change from open to closed. I would then expect that return to appear on the "closed returns" sheet and disappear from the "Open Returns" sheet.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Macro to display rows on separate sheets based on condition

    AdvancedFilter will suite for this
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Macro to display rows on separate sheets based on condition

    Your code works great!
    However, how do i get it to execute automatically when i change a value on "Return Log." Right now i have to run the macro manually.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Macro to display rows on separate sheets based on condition

    Then place the following code onto "Retun Log" sheet code module.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Macro to display rows on separate sheets based on condition

    Excellent!
    Thank You!

  6. #6
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Macro to display rows on separate sheets based on condition

    I've copied and modified your original code to sort information from "Closed returns" sheet into 12 other sheets (for 12 months) but its not quite working yet. Im sure i messed up something simple. Can you take a look?
    So the flow will be, data entry into "return log", sort to "open" and "closed", and from "closed" sort to month.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Macro to display rows on separate sheets based on condition

    1) Delete current codes.
    2) To a standard module
    Please Login or Register  to view this content.
    3) To ThisWorkbook code module.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Macro to display rows on separate sheets based on condition

    Hello Again,
    I just tried inserting another header row above my spreadsheet that will remain static and changed the one line of your code from Range("a1:a2") to Range("a2:a3") and the code no longer copies anything. Any thoughts?

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Macro to display rows on separate sheets based on condition

    phbryan,

    Sorry I was away.

    Can you upload a 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. Copy rows from multiple sheets based on condition
    By murzilka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2016, 04:49 PM
  2. Separate and align rows from two separate sheets based on a cell value.
    By Sonny Crockett in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2015, 09:15 PM
  3. Creating separate sheets based on single rows in list?
    By Taxster in forum Excel General
    Replies: 3
    Last Post: 12-16-2014, 04:24 PM
  4. Replies: 3
    Last Post: 01-03-2014, 02:13 AM
  5. Refering certain rows in other sheets based on a particular condition
    By werunom in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2013, 11:32 PM
  6. Refering certain rows in other sheets based on a particular condition
    By werunom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2013, 09:32 PM
  7. Copy Rows to Sheets Based on Condition
    By chcampbell12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2013, 12:42 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