Hi People!
I love sugar and I have a workbook with a bunch of candy companies listed in Column B.
I need to make my userform launch when a user selects one of these companies, and populate different text boxes of the form with offsets of the targeted range.
How do I summon the userform? How do I update the values of the boxes?
I've attached an example of what I'm working with.
Here is my codey bits so far:
Text Boxes:![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Target, Range("B2:B4")) Is Nothing And Target.Count = 1 Then 'how to summon userform? End If End Sub
txtCompany should equal Target
txtAddress should equal concatenation: Target.Offset(0,1) & Chr(10) & Target.Offset(0,2) & ", " & Target.Offset(0,3) & " (" & Target.Offset(0,4) & ")"
txtOppCount should equal Target.Offset(0,5)
txtSpend should equal Target.Offset(0,6)
txtAverage should equal Target.Offset(0,7)
Changing selections on the worksheet should update the form accordingly.
Normally I can answer these questions myself but I think my brain is full today.
Bookmarks