+ Reply to Thread
Results 1 to 8 of 8

Input box to run a macro multiple times

  1. #1
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Input box to run a macro multiple times

    How do I use an input box to run a simple macro multiple times? I want the user to be able to enter a number after a button is clicked and then the macro will run that many times.

    My macro calls 4 other macros that all need to be run so it's pretty simple.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: Input box to run a macro multiple times

    Check this out

    http://www.excelforum.com/excel-gene...-of-times.html
    ~~LaffyAffy13~~

    If I have helped you solve your problem, please be sure to click at the bottom left of my post.

    Thanks.

  3. #3
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Input box to run a macro multiple times

    Thanks for the response! I know how to run a macro multiple times, I just have no experience with input boxes and calling their inputs. Would
    Please Login or Register  to view this content.
    I don't know how to test for bad inputs either. If they put in anything that is not an integer then it won't work.

  4. #4
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Input box to run a macro multiple times

    Nevermind, it does that on its own!

  5. #5
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: Input box to run a macro multiple times

    Haha no way, I just found the exact same thing and edited it on my own.
    Please Login or Register  to view this content.
    When I run mine, if anything other than an integer is entered, i get an error "The number is not valid" and if its a decimal, it rounds to the nearest whole number. What is your current issue?

  6. #6
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Input box to run a macro multiple times

    I'm not having any errors, I thought I would! I'm used to programming in C where you have to create and account for all those errors haha thanks for your help

  7. #7
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: Input box to run a macro multiple times

    Oh cool. Glad I could help

  8. #8
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Input box to run a macro multiple times

    If I want it to display an error if the number entered is larger than 20 how would I manage that?
    Please Login or Register  to view this content.
    That gives me an error for any number entered...

  9. #9
    Registered User
    Join Date
    06-05-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    90

    Re: Input box to run a macro multiple times

    Nevermind, TypeName(x) hadn't saved as TypeName(response). It works now.

+ 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 for running the SQL multiple times
    By sawoodalam1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-27-2013, 07:00 AM
  2. Trying to run a macro multiple times
    By stevensmith867 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2013, 06:05 AM
  3. [SOLVED] copying a row multiple times using a macro
    By TSM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-12-2012, 03:28 AM
  4. Run Macro at multiple set times
    By dsrt16 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-17-2009, 11:36 AM
  5. Run macro multiple times
    By kriemer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2005, 11:40 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