+ Reply to Thread
Results 1 to 3 of 3

UserForm with ComboBox? is it possible?

  1. #1
    Registered User
    Join Date
    01-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    UserForm with ComboBox? is it possible?

    Hello everyone.
    What I've got is an UserForm with an InputBox. Whatever user gonna type there - it will be used as a name for new worksheet.
    It's fine and it is working. But what I would like to do is to add a ComboBox with selection of 3 words (for example: car, truck, bike). I need that in my future code where I will be looking for a worksheet based on its name, so those 3 words from combobox would be kind of a tags for each worksheets. For example:
    Please Login or Register  to view this content.
    So in that case it wouldn't matter what name the user would give to the new worksheet, cos he will have to chose a type from ComboBox.
    So the final name would something like that:
    strName = InputBox + ComboBox
    ActiveSheet.Name = strName

    Bellow is a working code for a user form without a comboBox.



    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by novak100; 02-22-2012 at 10:51 AM. Reason: SOLVED

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: UserForm with ComboBox? is it possible?

    try this (when you add combobox on your form)
    Please Login or Register  to view this content.
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  3. #3
    Registered User
    Join Date
    01-24-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: UserForm with ComboBox? is it possible?

    Thanks for that.
    Using Your ideas i was able to solve my problem.
    I decide to share my solution here in case someone in future will be looking for informations how to get data from combobox.
    This is my piece of code:

    I got a macro which loads data from selected files and at the end of that macro im calling for my userform called"SheetNewName" :
    Please Login or Register  to view this content.
    In my userForm I've got a comboBox called combo and confirmation button called "CommandButton1".
    This is the piece of code behind the button:

    Please Login or Register  to view this content.
    As you can see UserForm will hide itself and run another macro called "GetSheetName".
    This is code:

    Please Login or Register  to view this content.
    It will activate "sheet3" (whole uploaded data will go here), rename it to whatever is in "FullName" and create new worksheet called "sheet3" for future data uploads.

+ 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