+ Reply to Thread
Results 1 to 5 of 5

Macro to copy rows to another worksheet based on condition

  1. #1
    Registered User
    Join Date
    11-18-2012
    Location
    Amsterdam, NY
    MS-Off Ver
    Excel 2010
    Posts
    3

    Macro to copy rows to another worksheet based on condition

    Good day,

    I need to develop a macro that will copy rows within a worksheet to a new worksheet based on specific conditions. I'm using hyperlinks, but it's not working very well.

    For example, my first work book has subtotals on the Sq. FT. So if my sq. ft is <= 500, then it should automatically take me to the "Core" Spreadsheet and automatically copy the first 50 rows in the Master DAS Estimator Original workbook to the Core.

    if my sq. ft is >500 and <=1000, then it should automatically take me to the "First Tier" Spreadsheet and automatically copy the first 75 rows in the Master DAS Estimator Original workbook to the First Tier.


    A B C D
    Type Floor Sq. FT Percentage


    It would be greatly appreciated if someone could help me.

    I've included a sample file.

    Thanks!
    W.
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to copy rows to another worksheet based on condition

    You do not have sheets created for Second and Third Tier, do you want the macro to create these sheets for you?

    Also, do you want the total rows to get copied to?

    From which sheet should the data be copied to the Tier sheets?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    11-18-2012
    Location
    Amsterdam, NY
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to copy rows to another worksheet based on condition

    Hi Arlette,

    Actually, I would like the macro to create the Core, First Tier, Second Tier, and Third Tier workbooks by copying rows from the Master DAS Estimator test workbook

    based upon the Subtotal in Column C and the Percentage in Column D from the Type Sq. Ft workbook.

    Percentage should be calculated by the subtotal # of floors/total number of floors

    So, Core is the subtotal of the first 5 floors. (A2:A9)+(A20:A32)

    Next, would be First Tier which is the subtotal of the first 20 floors (A2:A9) + (A20:A34)

    Does this make any sense?

    Type Floor Sq. FT Percentage
    Core 1 200
    Core 2 50
    Core 3 25
    Core 4 100
    Core 5 50
    Core Total 425 11%
    First Tier 6 50
    First Tier 7 75
    First Tier 8 100
    First Tier 9 200
    First Tier 10 50
    First Tier 11 100
    First Tier 12 100
    First Tier 13 50
    First Tier 14 200
    First Tier 15 100
    First Tier 16 50
    First Tier 17 50
    First Tier 18 50
    First Tier 19 100
    First Tier 20 200
    First Tier Total 1475 43%
    Second Tier Total 0 76%
    Third Tier Total 0 100%


    I'd really appreciate it if you could help me as well as explain the logic of how you are executing the steps!

    W.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to copy rows to another worksheet based on condition

    Do you want to copy the data to a new worksheet or new workbook? Your title states worksheet but your above post says workbook.

  5. #5
    Registered User
    Join Date
    11-18-2012
    Location
    Amsterdam, NY
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to copy rows to another worksheet based on condition

    Sorry for the confusion, I would like it to be in a new worksheet at the end.

    Thanks,

+ 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