+ Reply to Thread
Results 1 to 8 of 8

subscript out of range when run user form to select sheet from combobox

  1. #1
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    448

    subscript out of range when run user form to select sheet from combobox

    Hi
    I would fixing subscript out of error in this line
    Please Login or Register  to view this content.
    that's because combobox5 is empty when run the form also this line
    Please Login or Register  to view this content.
    will be relating with combobox5.
    my request I would when run the form will not show any thing is listbox, but when select sheet name will populate data in listbox based on combobox5 , don't change the others procedure because I need it.
    the others comboboxes will depend each other of them after select sheet name from combobox5
    thanks
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,652

    Re: subscript out of range when run user form to select sheet from combobox

    The second line needs to change from

    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The first line needs some code to check the value in the combo box before trying to set the ws variable.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    448

    Re: subscript out of range when run user form to select sheet from combobox

    The first line needs some code to check the value in the combo box before trying to set the ws variable.
    that's why I posted here to find help !

  4. #4
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Win 11)
    Posts
    3,331

    Re: subscript out of range when run user form to select sheet from combobox

    Try:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    448

    Re: subscript out of range when run user form to select sheet from combobox

    @ByteMarks
    thanks
    show mismatch error in this line
    Please Login or Register  to view this content.

  6. #6
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Win 11)
    Posts
    3,331

    Re: subscript out of range when run user form to select sheet from combobox

    Does this work for you?
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    448

    Re: subscript out of range when run user form to select sheet from combobox

    perfect!
    thank you so much.

  8. #8
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Win 11)
    Posts
    3,331

    Re: subscript out of range when run user form to select sheet from combobox

    You're welcome

+ 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. [SOLVED] select range as in the first range without using scroll bar based on combobox on form
    By Ali-M in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2023, 12:52 PM
  2. Replies: 3
    Last Post: 07-09-2015, 10:26 AM
  3. [SOLVED] populate user form combobox based on dynamic range
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2015, 09:22 PM
  4. [SOLVED] User-Form Problem: User can select headers in User Form (I want Header/no way to select)
    By navialivad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2014, 10:24 AM
  5. [SOLVED] Subscript out of range for User Form
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2013, 06:53 AM
  6. [SOLVED] Populating user form combobox with range question
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2013, 05:06 PM
  7. subscript out of range when trying to select a sheet.
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2012, 03:39 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