+ Reply to Thread
Results 1 to 2 of 2

Add/remove rows to a range based on filter rows of another range

  1. #1
    Registered User
    Join Date
    09-19-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Add/remove rows to a range based on filter rows of another range

    Hi,

    I have table "Users" which has 2 columns username and usertype, where usertype can be "student" or "teacher". This table is periodically updated from external data source (usernames and usertypes may be changed, and new rows may be added for new users or existing rows deleted as users are removed from the data source).

    I have another table called "Students" which has 2 columns "username" and "grade". This table contains only the entries from Table "Users" that have usertype = "Student". The grades need to be manually input for each student in Excel.

    The problem I want to solve is this.

    Periodically, the Table Users will be updated as mentioned above. I would like a VBA solution that goes through the "Students" table, remove all rows that are no longer in the "Users" table, add new rows that are in the "Users" table but not yet in the "Students" table, and (optional) highlight them so that I know these users need to have their information updated.

    Does anybody have a piece of code that does something similar to this?

    Thanks!

    Jube

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Add/remove rows to a range based on filter rows of another range

    Try this in attached workbook

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

+ 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. Insert rows in between a range from another range based on dates
    By siprem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2016, 09:01 AM
  2. Replies: 1
    Last Post: 11-24-2015, 03:00 AM
  3. VBA how to remove rows based on a specified date range
    By clammastak in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-15-2015, 03:09 PM
  4. [SOLVED] First unhide all rows - then hide rows based on specific cell value for a range of cells
    By robbiekh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2013, 05:46 PM
  5. Replies: 4
    Last Post: 09-24-2013, 05:44 AM
  6. Hide rows in range 2 based on filter selection in range 1
    By gtol in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-28-2012, 02:09 PM
  7. add and remove rows from a called range
    By Buddy Lee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2005, 11:05 AM

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