picking a userform to show

  • Thread starter Thread starter natanz
  • Start date Start date
N

natanz

I have a userform with listbox which reads in a list from an excel
spreadsheet. When the user selects an item from the list I want to be
able to open a second userform, which will vary based on the first
selection. In my spreadsheet, the column adjacent to the list that
shows in the initial listbox, has the name of the userform i want to
bring up. I am able to find this name, because my MsgBox shows it, but
how can i get VBA to recognize that string as a userform name.

Private Sub LotList_Click()
Dim UnitType As String
Dim LotIndex As Integer
LotIndex = LotList.ListIndex
Range("lotnumbers").Offset(LotIndex, 1).Select
UnitType = CStr(ActiveCell.Value)
UnitType.show 'this is the line that is not
working
MsgBox UnitType

I am pretty new at this, and maybe trying something a little over my
head. I hope someone can help me. I appreciate any advice you have to
offer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top