+ Reply to Thread
Results 1 to 4 of 4

How to repeat a macro x number of times based on a value in a cell

  1. #1
    Registered User
    Join Date
    09-05-2011
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    2

    How to repeat a macro x number of times based on a value in a cell

    My apologies if I do not have this formatted correctly, this is my first time posting.

    I have a spreadsheet (attached) that runs a macro to copy a column of data from one page to the next. The criteria used to determine which column to copy is determined by the value in cell C147 (which be updated at a later time). The number of times to repeat the macro is determined by a countif command in cell C124, which counts the number of times the value in cell C147 is in row 122.

    Here is the macro that I want to repeat:


    Sub Move()
    '
    ' Move Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+M
    '
    Please Login or Register  to view this content.

    Any help would be appreciated.

    Thanks.
    Attached Files Attached Files
    Last edited by gypsyhotelier; 09-19-2011 at 05:15 PM. Reason: Solved! Thank You MarvinP!

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: How to repeat a macro x number of times based on a value in a cell

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: How to repeat a macro x number of times based on a value in a cell

    Hi gypsyhotelier and welcome to the forum

    Try this type of code

    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    09-05-2011
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    2

    Smile Re: How to repeat a macro x number of times based on a value in a cell

    Thank you so much. That did the trick!

+ 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