+ Reply to Thread
Results 1 to 4 of 4

Subscript out of range when creating userform

  1. #1
    Registered User
    Join Date
    11-02-2020
    Location
    singapore
    MS-Off Ver
    10
    Posts
    2

    Unhappy Subscript out of range when creating userform

    Hi all, am very new to VBA so pardon if this is a stupid question!

    I created a userform which basically has some blanks to fill in, and then a new sheet will be created based on a template. However I get the error 9/ subscript out of range occasionally, while other times the code works fine. When it works fine, I've been copy pasting values into the textboxes, and other times when I type into the userform from scratch, the error usually occurs. So I'm not sure where the problem is really :( Would appreciate any help and thank you!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: Subscript out of range when creating userform

    Try changing the code to:

    Please Login or Register  to view this content.
    and see if that helps.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    11-02-2020
    Location
    singapore
    MS-Off Ver
    10
    Posts
    2

    Re: Subscript out of range when creating userform

    Hi rorya, thanks for the help! Unfortunately, I made the userform appear on the sheet called "MasterData", and after clicking submit, although a new sheet is created fine, the "MasterData" sheet is also affected by the userform.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: Subscript out of range when creating userform

    What do you mean by "affected by"?

+ 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. "Runtime error '9': subscript out of range" when running UserForm
    By Niccii in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-23-2019, 04:39 PM
  2. [SOLVED] Subscript out of range (Error 9) | Creating Multiple Tables on Sheets using a For Next
    By learning new things in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-15-2018, 04:55 PM
  3. [SOLVED] Unusual "subscript out of range error" on userform initialise
    By Sc0ut in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-31-2015, 06:49 PM
  4. Subscript out of range userform error
    By Lmason7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 10:01 AM
  5. Subscript out of range error for creating object.
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2012, 12:07 PM
  6. Run-time error '9': Subscript out of range when trying to open a UserForm
    By Kungfauxn00b in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2010, 02:23 PM
  7. Userform submit to Worsheet (Subscript out of range)
    By Rampage in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-05-2010, 10:26 AM

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