+ Reply to Thread
Results 1 to 7 of 7

Copy rows based on value

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    karachi
    MS-Off Ver
    Excel 2007
    Posts
    28

    Copy rows based on value

    I have a bill for customer. TO record bills I have two sheets. One store Bill number. Order Number, date, customer, total quantity, total amount.
    Another sheet say RECORD store Bill number, date, customer name and goods details from bill.
    I have dedicated 17 rows (R13-29) and 5 columns (C2-C6) for goods in bill. But I want to store only rows with data. Lets say I have 5 goods in bill,
    so i want to copy contents of R13-R17 data in record sheet from 4 column and onwards. First three columns of that sheet store bill number, date and customer name.

    bill.xlsx

  2. #2
    Registered User
    Join Date
    10-10-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    41

    Re: Copy rows based on value

    Try this and let me know if it helps.

    Please Login or Register  to view this content.
    Vidya Palani

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    karachi
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Copy rows based on value

    It can copy cells with data. but it doesn't insert new rows above. Also the bill number dragging is for 3 cells. My requirement needs an if statement. I know its simple. I just don't understand how to handle loop for that.

  4. #4
    Registered User
    Join Date
    10-10-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    41

    Re: Copy rows based on value

    Insert rows where? Can you elaborate?

  5. #5
    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: Copy rows based on value

    Hi Umair.711

    If I understand your requirements this Code may help.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    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.

  6. #6
    Registered User
    Join Date
    10-02-2012
    Location
    karachi
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Copy rows based on value

    Quote Originally Posted by jaslake View Post
    Hi Umair.711

    If I understand your requirements this Code may help.
    Please Login or Register  to view this content.


    Got it. Thanks . It worked perfectly

  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: Copy rows based on value

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

    If this resolves your issue please mark your Thread as SOLVED.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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. Macro to copy rows based on moving date and paste the rows into an identical sheet
    By ivandc1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2014, 11:59 AM
  2. [SOLVED] Insert rows based on the current cell value and, then, copy some cells into the new rows
    By Excel-RZ in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-03-2013, 05:19 PM
  3. Replies: 0
    Last Post: 06-06-2013, 02:03 AM
  4. [SOLVED] insert rows based on number in cell and copy the data down into the new rows
    By pziefle in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-05-2013, 11:19 AM
  5. [SOLVED] Insert Multiple Rows Based Off Number in Cell and Copy Data From Above New Rows
    By tstell1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2012, 04:15 PM

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