+ Reply to Thread
Results 1 to 5 of 5

macro to copy rows that are highlighted to another sheet 2

  1. #1
    Registered User
    Join Date
    06-26-2015
    Location
    london
    MS-Off Ver
    2007
    Posts
    33

    macro to copy rows that are highlighted to another sheet 2

    Hi

    Was hoping someone could point me in the right direction

    I have a spreadsheet that has a list of dates, names and Rooms (7 coloums).
    At the moment i have a Cell in which i would type in Room 1 and it would highlight all the cells that have Room 1 in it (conditional Formatting)
    Then i would open Sheet 1 and sheet 2 side by side and 'copy' & 'paste value' to sort each list into sorted lists.

    Been stuck on creating a macro button that could do this copy the row which has a highligted cell and paste it into the cells i want it to.

    Any help would be much appreciated

    thankyou
    Attached Files Attached Files
    Last edited by joseph_pat; 05-24-2016 at 03:34 PM.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: macro to copy rows that are highlighted to another sheet 2

    Why bother with VBA when you can make a pivot table that will automatically grab what you need and you can filter on the room number?

    If you are trying to create little reports on each sheet for a different room number, then create a pivot on a sheet with a room filter, then copy the sheet and change the filter.
    Then when you add data, you can have the pivots refreshed and it flows to all of them without any VBA.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    06-26-2015
    Location
    london
    MS-Off Ver
    2007
    Posts
    33

    Re: macro to copy rows that are highlighted to another sheet 2

    Unfortunately i have considered that option and would have to stick to macros - the data then needs to be added to and modified - hence only a macro would be ideal

    thankyou for the input

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: macro to copy rows that are highlighted to another sheet 2

    How is your data so unique that you can't use a pivot table?

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: macro to copy rows that are highlighted to another sheet 2

    Sheet1 h1 = "Room"
    Sheet1 h2 = The Room eg. Rm 1

    When H2 is changed the following code is triggered (NOTE: code must be copied into Sheet1's code window

    EXPLAINATION: This macro utilizes excels "advanced filter" feature. It utilizes H1:H2 as the criteria to filter on room and then copies the filtered information to sheet2

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by nimrod; 05-26-2016 at 11:57 AM.

+ 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 Highlighted Rows to another sheet
    By MBCMDR in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-07-2016, 08:56 AM
  2. Formula to Copy highlighted rows into another sheet in same workbook?
    By JDMusic in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-12-2015, 10:49 PM
  3. [SOLVED] copy all highlighted rows to new sheet in order
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2014, 02:21 PM
  4. Replies: 0
    Last Post: 11-12-2013, 04:56 PM
  5. Deleting rows not highlighted by conditional formatting
    By JakeMann in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 08:01 AM
  6. [SOLVED] Conditional format to hide 0 w Odd,Even rows highlighted.
    By JO505 in forum Excel General
    Replies: 4
    Last Post: 03-03-2013, 08:19 PM
  7. [SOLVED] highlight/remove highlight of rows conditional on cellvalue
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2012, 07:14 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