freddie mitchell
New Member
- Joined
- Apr 14, 2011
- Messages
- 43
Hello everyone.
Super simple question that, I assume, has a blindingly obvious answer that I'm missing.
I have a ComboBox on my userform that populates select cells in a connected sheet. Feedback from the userform's users means that I'm now transforming the ComboBox into a listbox. I've got the listbox working in the userform, except it won't populate the cells. I've tried modifying the existing combobox code, see below, but no such luck. Does anyone have thoughts / suggestions on how to solve this?
Existing combobox:
And here's my basic changes:
Thank you,
Super simple question that, I assume, has a blindingly obvious answer that I'm missing.
I have a ComboBox on my userform that populates select cells in a connected sheet. Feedback from the userform's users means that I'm now transforming the ComboBox into a listbox. I've got the listbox working in the userform, except it won't populate the cells. I've tried modifying the existing combobox code, see below, but no such luck. Does anyone have thoughts / suggestions on how to solve this?
Existing combobox:
VBA Code:
Public Sub Insert_Row()
If ComboBox.Value = "X1" Then Cells(r, 9).Value = Cells(r, 10).Value & "X1"
If ComboBox.Value = "X2" Then Cells(r, 10).Value = Cells(r, 11).Value & "X2"
If ComboBox.Value = "X4" Then Cells(r, 8).Value = Cells(r, 9).Value & "X4"
If ComboBox.Value = "X5" Then Cells(r, 11).Value = Cells(r, 12).Value & "X5"
If ComboBox.Value = "X6" Then Cells(r, 12).Value = Cells(r, 13).Value & "X6"
End With
End Sub
And here's my basic changes:
VBA Code:
If ListBox.Value = "X1" Then Cells(r, 9).Value = Cells(r, 10).Value & "X1"
If ListBox.Value = "X2" Then Cells(r, 10).Value = Cells(r, 11).Value & "X2"
If ListBox.Value = "X4" Then Cells(r, 8).Value = Cells(r, 9).Value & "X4"
If ListBox.Value = "X5" Then Cells(r, 11).Value = Cells(r, 12).Value & "X5"
If ListBox.Value = "X6" Then Cells(r, 12).Value = Cells(r, 13).Value & "X6"
Thank you,