Ryanchris
10-24-2019, 09:21 PM
Newby here...again!
I have a reset button (actually named "New System") that gets pushed AFTER the "Upload" button is hit and is designed to clear my userform. The issues I am having is using the vbYes/No in my MsgBox. If "New System" button is pushed, and user confirms "yes" - I want the sheet to clear. If they select "no", I want the sheet to just stay exactly as it is. I feel like this should be easy but what the hell am I missing??!!
Here is my current code:
Private Sub CommandButton17_Click()
MsgBox "Do not forget to UPLOAD your configuration. Are you sure you want to continue?", vbYesNo, "New Config"
If vbYes Then
Dim ctl As Control
For Each ctl In CondensingUnitConfig.Controls
If TypeName(ctl) = "TextBox" Then
ctl.Value = ""
End If
Next ctl
For Each ctl In CondensingUnitConfig.Controls
If TypeName(ctl) = "ComboBox" Then
ctl.Value = ""
End If
Next ctl
End If
End Sub
I have a reset button (actually named "New System") that gets pushed AFTER the "Upload" button is hit and is designed to clear my userform. The issues I am having is using the vbYes/No in my MsgBox. If "New System" button is pushed, and user confirms "yes" - I want the sheet to clear. If they select "no", I want the sheet to just stay exactly as it is. I feel like this should be easy but what the hell am I missing??!!
Here is my current code:
Private Sub CommandButton17_Click()
MsgBox "Do not forget to UPLOAD your configuration. Are you sure you want to continue?", vbYesNo, "New Config"
If vbYes Then
Dim ctl As Control
For Each ctl In CondensingUnitConfig.Controls
If TypeName(ctl) = "TextBox" Then
ctl.Value = ""
End If
Next ctl
For Each ctl In CondensingUnitConfig.Controls
If TypeName(ctl) = "ComboBox" Then
ctl.Value = ""
End If
Next ctl
End If
End Sub