+ Reply to Thread
Results 1 to 9 of 9

Recording a Macro with Filtering and variable cell numbers

  1. #1
    Registered User
    Join Date
    08-06-2015
    Location
    Mesa, Arizona
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    84

    Recording a Macro with Filtering and variable cell numbers

    I am trying to record a macro that allows me to filter out certain information and copy and paste the information needed into another sheet -- the issue I am having is the cell numbers will vary each time so the macro errors out. Is there a way to move rows to another spreadsheet based on there being information in a certain column.

    In my situation I have the following information:

    A: Entity
    B: Building
    C: Unit
    D: Resident
    E: First Name
    F: Last Name
    G: CHC
    H: CHC Date
    I: Last Payment Date
    J: Resident Balance
    K: Assessment Amount
    L: Assessment Frequency

    I am wanting cells that contain: AD, DL, DM, FD, LP, PP or RM in column G to be moved to their own tabs.

    Please help!

    Thank you,

    Ashley

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Recording a Macro with Filtering and variable cell numbers

    You aren't going to be able to duplicate that in a recorded macro. It's going to have to be custom.

    If you want someone to write that for you then:

    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 use the paperclip icon to open the upload window.

    View Pic
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Registered User
    Join Date
    08-06-2015
    Location
    Mesa, Arizona
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    84

    Re: Recording a Macro with Filtering and variable cell numbers

    Here is an example with both a before and an after. Normally there will be about 600+ accounts but for this purpose I only kept a few. The amount of accounts for each tab will be different everytime the macro is ran so it needs to move it based off of column G "CHC".

    Thank you.
    Attached Files Attached Files

  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: Recording a Macro with Filtering and variable cell numbers

    Hi Ashley

    Are there just the 4 (RM, PP, AD and Pre-Legal and Demand)?
    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.

  5. #5
    Registered User
    Join Date
    08-06-2015
    Location
    Mesa, Arizona
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    84

    Re: Recording a Macro with Filtering and variable cell numbers

    There are 7 CHCs under column G

    RM has all the RMs
    PP has all the PPs
    AD has all the ADs
    and Pre-Legal and Demand has the following: DL, DM, FD, LP

    Thanks!

  6. #6
    Registered User
    Join Date
    08-06-2015
    Location
    Mesa, Arizona
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    84

    Re: Recording a Macro with Filtering and variable cell numbers

    There are 7 CHCs under column G

    RM has all the RMs
    PP has all the PPs
    AD has all the ADs
    and Pre-Legal and Demand has the following: DL, DM, FD, LP

    Thanks!

  7. #7
    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: Recording a Macro with Filtering and variable cell numbers

    Hi Ashley

    This Code in the attached could be shortened up but it appears to do the job. CTRL + x will fire the Code. Let me know of issues.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-06-2015
    Location
    Mesa, Arizona
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    84

    Re: Recording a Macro with Filtering and variable cell numbers

    Thank you so much! This is great!

  9. #9
    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: Recording a Macro with Filtering and variable cell numbers

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

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Recording a Macro with differing cell count
    By ashley72788 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2015, 05:16 PM
  2. Recording advanced filtering macro
    By niukvba in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-02-2014, 03:48 AM
  3. [SOLVED] vba macro code for filtering from the given numbers
    By Dharani Suresh in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-03-2013, 07:19 AM
  4. Macro/VBA Help for recording cell data
    By pezonaftis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-04-2013, 02:59 PM
  5. recording / graphing real-time variable cell values
    By Adamo in forum Excel General
    Replies: 8
    Last Post: 04-17-2009, 11:28 AM
  6. Recording macro using cell references in worksheet
    By sarabella in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-18-2007, 05:16 PM
  7. [SOLVED] Can't find cell ref. when recording a macro in excel
    By Vinod Lala in forum Excel General
    Replies: 3
    Last Post: 05-23-2006, 02:10 AM

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