+ Reply to Thread
Results 1 to 3 of 3

How to repeat a macro many times

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    San Jose, CA
    MS-Off Ver
    Microsoft 365 MSO
    Posts
    9

    How to repeat a macro many times

    Hi: I have a large data set in which I need to insert four cells in between each value, shifting the cells down each time. I recorded a macro to insert the 4 cells and shift down. Somehow I would like to be able to apply this macro to the entire data set (which is over1500 cells and will end up just under 7000 cells.) Is this possible to do in one or a few steps?
    Thanks for your help!
    Last edited by cbo; 12-07-2010 at 05:42 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to repeat a macro many times

    Many ways. Here's one way with no macros:

    1) IN an adjacent cell to you data, put in numbers, 1,2,3, etc. Just put in 1 and 2 in the first two columns, then highlight those two cells and drag the bottom right-corner down the whole data set to get the full set of numbers.

    2) Copy the full set of numbers and paste directly below the first set in the blank rows below. Do this 4 times.

    3) Now highlight both the number column and the original data column

    4) Sort ascending by the number column.

    5) Delete the numbers.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-14-2010
    Location
    San Jose, CA
    MS-Off Ver
    Microsoft 365 MSO
    Posts
    9

    Re: How to repeat a macro many times

    Thanks for your help JBeaucaire! That was so incredibly easy!

+ 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