Forum Discussion
sf49ers19238597
Dec 14, 2020Iron Contributor
I have a friend that need help with vab code
need help with part of vba code
If Me.cmbWeek.ListIndex > -1 Then
Set Ws = Worksheets(Me.cmbWeek.Value)
Else: MsgBox "INCORRECT INPUT." & vbNewLine & "Use Dropdown For Listed Weeks.", vbCritical, "INPUT ERROR"
cmbWeek.SelStart = 0
cmbWeek.SelLength = cmbWeek.TextLength
Exit Sub
End If
I not sure what do to change the code?
all the rest code is good in that selection
Thanks You
14 Replies
The code refers to a combo box named cmbWeek, but there is no combo box on the userform.
Delete the part of the code shown in your post (from If to End If)
- sf49ers19238597Iron Contributor
delete whole selection I mean an do not put anything or for new code?
Yes, simply select that part and press Delete. You don't have to replace it with anything.