Hi All,
I'm new to VBA so hope this question isn't too dumb!
I'd like to add a "Key" to a user form that can dynamically update should it need to.
Currently the user form has a number of comboboxes which have shortened codes in them to make entering the data faster, and so the resultant database/worksheet, the selection is entered onto, isn't unnecessarily wide. The downside of this is the user must know the coding (ie A = Apple, B = Banana, etc) otherwise they could enter the wrong item. I plan to add a key at the bottom of the form so any user can refer to it should they need to, but rather than hardcoding the "Key" I'd like to populate it by using the same Named Ranges the comboboxes are populated by.
Is there away to make a Userform Label equal to a named range??
I've tried
* setting the caption in the label properties as '=Named_Range
* using the code Userform_Name.Label_Name.Caption = Sheets("Sheet_Name").Range("Named_Range").Value in the Private Sub Userform_Initialize ()
* as well as defining the variables like
Dim Label_Name_Variable As String
Label_Name_Variable = Sheets("Sheet_Name").Range("Named_Range").Value
Userform_Name.Label_Name.Caption = Label_Name_Variable
I'm new to VBA so hope this question isn't too dumb!
I'd like to add a "Key" to a user form that can dynamically update should it need to.
Currently the user form has a number of comboboxes which have shortened codes in them to make entering the data faster, and so the resultant database/worksheet, the selection is entered onto, isn't unnecessarily wide. The downside of this is the user must know the coding (ie A = Apple, B = Banana, etc) otherwise they could enter the wrong item. I plan to add a key at the bottom of the form so any user can refer to it should they need to, but rather than hardcoding the "Key" I'd like to populate it by using the same Named Ranges the comboboxes are populated by.
Is there away to make a Userform Label equal to a named range??
I've tried
* setting the caption in the label properties as '=Named_Range
* using the code Userform_Name.Label_Name.Caption = Sheets("Sheet_Name").Range("Named_Range").Value in the Private Sub Userform_Initialize ()
* as well as defining the variables like
Dim Label_Name_Variable As String
Label_Name_Variable = Sheets("Sheet_Name").Range("Named_Range").Value
Userform_Name.Label_Name.Caption = Label_Name_Variable