+ Reply to Thread
Results 1 to 6 of 6

Userform label dependent from combobox

  1. #1
    Registered User
    Join Date
    12-31-2015
    Location
    Barreiro, Portugal
    MS-Off Ver
    MS Office 365
    Posts
    84

    Userform label dependent from combobox

    Hello everyone,

    I have a userform in which I have two comboboxes (one dependent from the other, depending from which i select first).

    Now I which to add a label that changes according to one of the comboboxes selection. I do not want to have it as a combobox since it's just remark, so the user can only see that remark after the selection from the combobox.

    I am able to make the label dependent from I what choose in the combobox, but I cannot put the right "values" in the label caption.

    Also, the caption should be something like "13 / 14", with 13 being the column where the information to the left of the dash is stored, and 14 the column to the right of the dash.

    Here's the whole userform code:

    Please Login or Register  to view this content.
    Thank you for your help

  2. #2
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Userform label dependent from combobox

    Hi,
    I'm not sure it's clear what is 13 and 14?
    If you know how to get those numbers then combine them in Label.Caption like this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-31-2015
    Location
    Barreiro, Portugal
    MS-Off Ver
    MS Office 365
    Posts
    84

    Re: Userform label dependent from combobox

    Hi,

    13 and 14 are just the column numbers where the information is. I have 13 as the variable temprmks in the code, as you might see in one of the comboxes (Me.ComboBoxRemarks.List). That one was just a test, but if I can do it as a label, then I will delete that combobox.

    Sorry about the misleading information.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Userform label dependent from combobox

    Hi,

    I'm afraid I don't follow your question so cannot help with that at the moment, but I would like to point out that your code will only work if the temp filter sheet happens to be active. You should change every statement that looks like this
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    or use a With block as you do near the beginning of the code
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Registered User
    Join Date
    12-31-2015
    Location
    Barreiro, Portugal
    MS-Off Ver
    MS Office 365
    Posts
    84

    Re: Userform label dependent from combobox

    Hi,

    Thank you for your reply.

    About my question, Just like I have two comboboxes (prices and suppliers), in which the information shown is dependent from the combobox I choose first (if i choose the supplier, then it shows me the correspondent price, vice-versa), I want another "box", but this one should not allow the user to see the different options, only what is presented after selecting the supplier. I believe the best userform control to do that is to use a label.

    Making it dependent works, but I cannot fill the caption with the information I desire. For the combobox, I used the .Listindex, but how can I have a range in the label caption?

    About your sugestion, the userform only appears in a specific situation, which creates a temporary sheet for the sole purpose of the userform, so for this case I do not see any gain in changing the code to that purpose, but I will keep it in mind for the future.

    Thanks you.

  6. #6
    Registered User
    Join Date
    12-31-2015
    Location
    Barreiro, Portugal
    MS-Off Ver
    MS Office 365
    Posts
    84

    Re: Userform label dependent from combobox

    Hi,

    Apologies about the duplicate answer
    Last edited by Rui Farinha; 01-13-2017 at 11:54 AM. Reason: Duplicate answer

+ 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] Dependent Combobox Userform
    By Frankinstyyn in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2014, 03:21 PM
  2. [SOLVED] UserForm: ComboBox #2 dependent on ComboBox #1
    By TexasAggie12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2014, 10:41 AM
  3. Displaying label from a userform combobox selection
    By pjrpower in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2012, 08:04 AM
  4. [SOLVED] Userform with two combobox dependent on one combobox
    By bigfoot007 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2012, 01:01 PM
  5. VBA Userform Dependent Combobox
    By TextMonkey in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-10-2011, 06:46 AM
  6. Dependent Combobox in Excel Userform
    By 2Deep in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-07-2010, 08:59 AM
  7. userform one combobox dependent on another
    By busydave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2010, 06:05 AM

Tags for this Thread

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