+ Reply to Thread
Results 1 to 2 of 2

Repeat cell x number of times depending on another cell

  1. #1
    Registered User
    Join Date
    10-09-2014
    Location
    Manila, Philippines
    MS-Off Ver
    365
    Posts
    11

    Repeat cell x number of times depending on another cell

    Hi,
    May I please request help on this?

    Col A: List of cells to be copied
    Col B: Number of times to be copied
    Col C: Copied + numbers
    Col D: Copied - number

    A B C D
    Banana 4 Banana Banana
    Apple 3 Banana Banana
    Orange 2 Banana
    Kiwi 2 Banana
    Banana -2 Apple
    Apple
    Apple
    Orange
    Orange
    Kiwi
    Kiwi

    Or is it better to have col C delete 2 banana cells instead?

    Thank you!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Repeat cell x number of times depending on another cell

    Here is some VBA to accomplish this

    Please Login or Register  to view this content.

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Replies: 1
    Last Post: 07-17-2015, 02:56 AM
  2. Repeat data in cell a set number of times by user
    By jezsmith in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-12-2015, 12:29 PM
  3. Repeat cell values a certain number of times
    By strother1990 in forum Excel General
    Replies: 2
    Last Post: 09-24-2014, 12:43 PM
  4. macro needed to repeat cell values for a specified number of times
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2014, 06:54 AM
  5. How to repeat vba code a number of times depending on items in an excel list
    By qaliq in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-18-2013, 08:13 AM
  6. How to repeat a macro x number of times based on a value in a cell
    By gypsyhotelier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2011, 05:11 PM
  7. Repeat a cell value in another column X number of times
    By art1234 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2011, 02:36 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