Consulting

Results 1 to 7 of 7

Thread: VBA code to copy and paste row based on certain criteria

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Oct 2013
    Posts
    2
    Location

    VBA code to copy and paste row based on certain criteria

    Dear all,

    Currently I have an excel table where I have a macro that based on a certain value in a cell (> 1), it will copy, insert new row and paste the entire row x number of times based on the value in the column "COUNT".

    What I need help with is I don't want the row to be copied exactly, but based on the value in "COUNT", for each paste the row will contain only one input value with the following pattern. It's hard to explain, so I hope the table below explains it.

    BEFORE
    count input input input input
    3 A A A
    AFTER
    count input input input input
    3 A A A
    3 A A A
    3 A A A
    3 A A A

    what I would like the macro to do:

    BEFORE
    count input input input input
    3 A A A
    AFTER
    count input input input input
    3 A A A
    1 A
    1 A
    1 A

    So if the value is 10, I want the macro to copy it 10 times but so each row has only one input value with an offset of 1.

    Attached is the excel with the current macro and an example how I wish it works.

    Thank you for your help!

    BR,

    T0NT0
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •