+ Reply to Thread
Results 1 to 7 of 7

User input, then repeat macro.

  1. #1
    Forum Contributor
    Join Date
    02-07-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    156

    User input, then repeat macro.

    Need a bit of help with this one.

    Trying to write a macro that when triggered, asks the user how many times is it to be repeated and the repeats it the specified number of times.

    Thanks !!
    Last edited by The Skipper; 07-03-2013 at 12:54 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: User input, then repeat macro.

    Hi, The Skipper,

    maybe like this:
    Please Login or Register  to view this content.
    You should replace the line in the loop with what you really want the code to do - here itīs only putting date and time and the number of the loop counter to the Immediate Windiow.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    02-07-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    156

    Re: User input, then repeat macro.

    Thanks.......worked great !!

    Is there a way to make the macro loop back to a specific part of the code?

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: User input, then repeat macro.

    Hi, Skipper,

    sorry, I seem to not fully understand what you mean. Is it something like
    Please Login or Register  to view this content.
    Ciao,
    Holger

  5. #5
    Forum Contributor
    Join Date
    02-07-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    156

    Re: User input, then repeat macro.

    The macro is quite long, and the first 13 lines of code are unique and I don't want those lines to be 'looped'. The part of the macro to be 'looped' actually begins at line 14 of the code.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: User input, then repeat macro.

    Hi, Skipper,

    then maybe use a boolean for the part only to be run once
    Please Login or Register  to view this content.
    Ciao,
    Holger

  7. #7
    Forum Contributor
    Join Date
    02-07-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    156

    Re: User input, then repeat macro.

    Worked fine.........looping to correct line of code.

    Thanks alot !!

+ 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