+ Reply to Thread
Results 1 to 6 of 6

copy a cell multiple times depending on cell value starting on a specific cell

  1. #1
    Registered User
    Join Date
    08-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    copy a cell multiple times depending on cell value starting on a specific cell

    Hello!

    I am trying to copy/paste a cell a number of times depending on the value of another cell (B2) starting in a specified cell.
    The specified cell depends on the month and year the user inserts on the spreadsheet.

    So the cell to be copied is on cell A3, and the number of times it should be copies is on cell B3.
    Columns on the right are labeled with years and months, and according to the month and year specified by the user (cell C3 and cell D3) the starting cell.

    Example:
    I need to be displayed $10,000 3 times, starting in the column corresponding to October 2013 (column f) and the next 2 (column G and H) to make a total of three.
    Need to be display $20,000 2 times, starting in column January 2014 (column I) and the next column (column J) to make a total of two.

    A B C D E F G H I J K
    1 Amount Period Starting month Starting year 2013 2013 2013 2013 2014 2013 2014
    2 September October November December January February March
    3 $10,000.00 3 October 2013
    4 $20,000.00 2 January 2014


    Result:

    A B C D E F G H I J K
    1 Amount Period Starting month Starting year 2013 2013 2013 2013 2014 2013 2014
    2 September October November December January February March
    3 $10,000.00 3 October 2013 10,000 10,000 10,000
    4 $20,000.00 2 January 2014 20,000 20,000


    Hope I was clear enough.
    Thank you!
    (document attached)
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: copy a cell multiple times depending on cell value starting on a specific cell

    hi weritadiojomiel, welcome to Excelforum, option, please check attachment, press "Run" button or run code "test"
    Attached Files Attached Files

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy a cell multiple times depending on cell value starting on a specific cell

    e/ Nvm, didn't test and didn't see your formulas
    Last edited by Solus Rankin; 08-16-2013 at 04:54 PM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  4. #4
    Registered User
    Join Date
    08-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: copy a cell multiple times depending on cell value starting on a specific cell

    THANK YOU WATERSEV! This is amazing!

  5. #5
    Registered User
    Join Date
    08-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: copy a cell multiple times depending on cell value starting on a specific cell

    What if the value to be copied is a formula?
    It looses the formula once running the macro.

    Is it possible to keep the value as a formula?
    Thanks!

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: copy a cell multiple times depending on cell value starting on a specific cell

    please check attachment, formula is in A4 as an example
    Attached Files Attached Files

+ 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 that is column specific & changes cell color depending on cell contents
    By zurispowell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2012, 05:03 PM
  2. Fill specific cell depending on the number provided in a cell
    By ifticalgary in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2011, 03:13 PM
  3. Replies: 5
    Last Post: 09-30-2010, 01:50 PM
  4. Copying specific cell ranges from a worksheet multiple times to a new sheet
    By kaz8772 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2009, 03:54 PM
  5. Replies: 1
    Last Post: 07-06-2006, 07:55 PM

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