+ Reply to Thread
Results 1 to 5 of 5

Need to get Value from ComboBox Form Control

  1. #1
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Need to get Value from ComboBox Form Control

    Dear all,

    I hope you are all well.

    I have a ComboBox Form Control in one sheet. The combobox drop down list contains the name of all sheets available. Under the combobox, I have a commandbutton so when a user selects the sheet name from the ComboBox form control and clicks the CommandButton, a range from sheet1 will be copied to the selected sheet.

    I have changed the form control name to "MonthDropDown".

    Here's the code I am using:

    Please Login or Register  to view this content.
    The problem I am facing is an 'Run-Time error 9' - Subscript out of range on the range outlined in red.

    Any ideas on how to Debug this error?

    You assistance on this matter will be highly appreciated.

    Best regards,
    Filipe Oliveira.
    Last edited by pipoliveira; 06-25-2013 at 08:43 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Need to get Value from ComboBox Form Control

    I think you'll find the problem is with the assignation of sname ..
    To prove it you could add
    Msgbox sname
    directly after
    sname = .Shapes("MonthDropDown").ControlFormat.Value
    Elegant Simplicity............. Not Always

  3. #3
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Need to get Value from ComboBox Form Control

    Hi Andy,

    Thanks for the update.

    I searched some other examples and I found the solution.

    Here's what was missing:

    Please Login or Register  to view this content.
    Now it works perfectly!

    Thanks a million. Really appreciated.
    Filipe

  4. #4
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Need to get Value from ComboBox Form Control

    Hi Andy,

    Thanks for the update.

    I searched some other examples and I found the solution.

    Here's what was missing:

    Please Login or Register  to view this content.
    Now it works perfectly!

    Thanks a million. Really appreciated.
    Filipe

  5. #5
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Need to get Value from ComboBox Form Control

    Nice job!

+ 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