+ Reply to Thread
Results 1 to 16 of 16

what is causing macro to loop?

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    what is causing macro to loop?

    Why is this Making the macro loop

    Please Login or Register  to view this content.
    Macro that is looping
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    the macro itself is not looping when ran alone. Just when it is in the userform with the close button that it loops.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520
    Remove application.run at the bottom of the code.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    I removed that command but now the Macro is not running.

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: what is causing macro to loop?

    You must have this in the close event of your form

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    Here is my entire event for the Form
    I thought that the close button was my close event. If it is not how do I add this event.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: what is causing macro to loop?

    Do a find. Hit Ctrl+F patse abc() in the Find What box. Select Current project and hit find next until you find the quilty culprit triggering the abc() code. Or post your workbook and I'll take a look at it.

  8. #8
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    Fallowing your instructions I can only find one abc() in the main program.

    I have attached workbook
    Last edited by Neisany; 09-27-2012 at 07:38 PM.

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: what is causing macro to loop?

    Theres no code in the attatched workbook.

  10. #10
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    Sorry I sent the wrong one. Here is the correct one.

    Thanks Mike
    Attached Files Attached Files

  11. #11
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: what is causing macro to loop?

    You had this in the UserForm Click event. That will fire the Abc Macro anytime the form was clicked on
    Please Login or Register  to view this content.
    Replace the all code in your userform with this

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    Thanks for the input Mike. Couple of things that I am noticing.
    1. Even when the form is closed it seems to keep in mind where the last input was. It is cycling threw rows 2-8 (labeled as 1-7). It doesn't look for the next available row.
    2. It doesn't pull all the information from that I would like from the sheet "DataBase".
    3. The Macro that you helped me out with earlier is what was going to pull that information from one sheet to the other.
    Please Login or Register  to view this content.
    4. I like how clean the code was and how easy it was to read. I will diffidently start fallowing that example

  13. #13
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: what is causing macro to loop?

    So Im a little confussed as to what your wanting? When you fill out the form and hit Done the forms data goes to the Database Sheet. I guess Im not sure what your wanting to do with the other macro I wrote for you? Because all it does is gets some values from the lastrow of the DataBase sheet.

  14. #14
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    I have been learning from what you keep showing me and I am getting closer.
    The display page is only displaying some of the variables. The data page I want to be able to review everything.
    After I saved and closed Excel the issue I was having with the keeping count is now gone which is great!

    This is what I have added so far
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: what is causing macro to loop?

    Mike you have been a great help today. Thank you so much. I have Stared you with good feedback!

  16. #16
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: what is causing macro to loop?

    Thanks

    So the issuse is gone is there anything else your wanting to do?

+ 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