I'm trying to make Labels 27-33 read L36:L42 when I click the Assign button but somehow my other labels get changed and I'm not sure how to fix this.
Here is my userform, left is before I click Assign and right is after. Thank you!
photo1632445539 (1).jpeg
and here is my code, cmbassign is the Assign command button
Private Sub cmbassign_Click()
Call chgassign
End Sub
Sub chgassign()
i = 1
Set rg = Range("L36")
Set rg = Range("L37")
Set rg = Range("L38")
Set rg = Range("L39")
Set rg = Range("L40")
Set rg = Range("L41")
Set rg = Range("L42")
For Each ctrl In Me.Controls
If TypeName(ctrl) = "Label" And ctrl.Name = "Label3" & CStr(i - 1) Then
ctrl.Caption = rg(i).Value
i = i + 1
End If
Next
End Sub
Bookmarks