UserForm code to enter control values from multiple pages

  • Hi All,


    I'm trying to build a UserForm that has 878 controls on 8 pages of a multipage control. It's my first time creating one and I'm trying to use a code I found off one tutorial but I keep getting an error message and I'm hoping someone here might have some insight.


    Each control is labeled consecutively r1-r878, I've checked that all controls are in order. And in the code area for the SUBMIT button i have the following code:



    If I test the form, the information is entered into the spreadsheet but a message box appears with the following:


    Run-time error '-2147024809 (80070057)':
    Could not find the specified object.


    The debug function points to the line: nextrow=Me.Controls("r" & X).Value


    Is there any way to fix the bug?


    Thank you!

  • Re: UserForm code to enter control values from multiple pages


    Hello svalente34
    Welcome to the forum
    The page
    http://www.ozgrid.com/VBA/control-loop.htm

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!