+ Reply to Thread
Results 1 to 2 of 2

Macro to Copy Rows based on target cell value and paste in another sheet. Help Needed!

  1. #1
    Registered User
    Join Date
    09-02-2011
    Location
    Boston, Ma
    MS-Off Ver
    Excel 2007
    Posts
    21

    Macro to Copy Rows based on target cell value and paste in another sheet. Help Needed!

    Hi All,

    I have attached a sample workbook. I am trying to Run a Macro in the "Regional Stats" Sheet that will copy all rows from the "Data Summary" sheet where the cell in column J is less than -999 and paste them back in the "Regional Stats" sheet from row 6 on because there will be other information in rows 1-5.

    The code I wrote clears the contents of all rows (6 down) in the regional stats sheet first so that duplicates don't occur and the info will always start at row 6 when the Macro is run twice. The Data Summary sheet will be updated periodically with new information but will also retain the old information so I don't want duplicate entries in the Regional Stats sheet every time I run the macro.

    I can't seem to get it to work correctly so If someone could help me out it would be great! Also if anyone has input I would like to know if what I wrote is the most efficient way of achieving this. If there is a more efficient VBA script I would be all for it.

    The Macro seems to work ok and then when the Data Summary sheet gets sorted it breaks. I need to be able to sort it as people will be adding data sorting the Data summary sheet and then Management will be using the Macro to pull only the info they need to the Regional Stats sheet to avoid looking through rows of data for what they want.

    Here is the COPY AND PASTE code I am using
    Please Login or Register  to view this content.
    All input is greatly appreciated!!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Macro to Copy Rows based on target cell value and paste in another sheet. Help Needed

    Hi -

    Try;
    Please Login or Register  to view this content.
    Regards,
    event

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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