Harley78
Active Member
- Joined
- Sep 27, 2007
- Messages
- 372
- Office Version
-
- 365
- Platform
-
- Windows
I am trying to make a Configuration based on yes and now responses ( using message boxes ). I don't have the No part down, but basically it should go to the next message until you reach the end.
So I am just wondering if any of you pro's think there might be a better way of doing this.
Thanks
Private Sub CommandButton10_Click()
'
If MsgBox("Would you like to configure the 6020 Module?", vbYesNo) = vbYes Then
If CommandButton2.BackColor = RGB(255, 255, 0) Then CommandButton2.BackColor = RGB(255, 255, 255) Else CommandButton2.BackColor = RGB(255, 255, 0)
Range("A37").Value = 1 ' Opt. control panel, must pick always
If CommandButton8.BackColor = RGB(255, 255, 0) Then CommandButton8.BackColor = RGB(255, 255, 255) Else CommandButton8.BackColor = RGB(255, 255, 0)
Range("A11").Value = 1 ' Operational Manual
If CommandButton9.BackColor = RGB(255, 255, 0) Then CommandButton9.BackColor = RGB(255, 255, 255) Else CommandButton9.BackColor = RGB(255, 255, 0)
Range("A9").Value = 1 ' Parts List Manual
If CommandButton5.BackColor = RGB(255, 255, 0) Then CommandButton5.BackColor = RGB(255, 255, 255) Else CommandButton5.BackColor = RGB(255, 255, 0)
Range("A17").Value = 1 ' Base Folder
'
If MsgBox("Is this an Enduro configuration?", vbYesNo) = vbYes Then
If CommandButton7.BackColor = RGB(255, 255, 0) Then CommandButton7.BackColor = RGB(255, 255, 255) Else CommandButton7.BackColor = RGB(255, 255, 0)
Range("A25").Value = 1 ' Cable Kit
'
If MsgBox("Would you like HEAVY ROLLERS?", vbYesNo) = vbYes Then
If CommandButton6.BackColor = RGB(255, 255, 0) Then CommandButton6.BackColor = RGB(255, 255, 255) Else CommandButton6.BackColor = RGB(255, 255, 0)
Range("A21").Value = 1 ' Rollers - Sure Grip Folder
If CommandButton26.BackColor = RGB(255, 255, 0) Then CommandButton26.BackColor = RGB(255, 255, 255) Else CommandButton26.BackColor = RGB(255, 255, 0)
Range("A53").Value = 1 ' Rework rollers for heavy fold
'
If MsgBox("Did the customer order extra HEAVY fold plates?", vbYesNo) = vbYes Then
If CommandButton23.BackColor = RGB(255, 255, 0) Then CommandButton23.BackColor = RGB(255, 255, 255) Else CommandButton23.BackColor = RGB(255, 255, 0)
Range("A57").Value = 1 ' HEAVY Fold Plate #4
If CommandButton24.BackColor = RGB(255, 255, 0) Then CommandButton24.BackColor = RGB(255, 255, 255) Else CommandButton24.BackColor = RGB(255, 255, 0)
Range("A55").Value = 1 ' HEAVY Fold Plate #1
'
If MsgBox("Did the customer order extra MEDIUM fold plates?", vbYesNo) = vbYes Then
If CommandButton21.BackColor = RGB(255, 255, 0) Then CommandButton21.BackColor = RGB(255, 255, 255) Else CommandButton21.BackColor = RGB(255, 255, 0)
Range("A63").Value = 1 ' Medium Fold Plate #4
If CommandButton22.BackColor = RGB(255, 255, 0) Then CommandButton22.BackColor = RGB(255, 255, 255) Else CommandButton22.BackColor = RGB(255, 255, 0)
Range("A61").Value = 1 ' Medium Fold Plate #3
'
If MsgBox("Accumulation Required?", vbYesNo) = vbYes Then
If CommandButton14.BackColor = RGB(255, 255, 0) Then CommandButton14.BackColor = RGB(255, 255, 255) Else CommandButton14.BackColor = RGB(255, 255, 0)
Range("A29").Value = 1 ' Accumulation
'
If MsgBox("Do you require Single Accumulation?", vbYesNo) = vbYes Then
If CommandButton16.BackColor = RGB(255, 255, 0) Then CommandButton16.BackColor = RGB(255, 255, 255) Else CommandButton16.BackColor = RGB(255, 255, 0)
Range("A31").Value = 1 ' Single Deck Accumulation
'
If MsgBox("Do you require Dual Accumulation?", vbYesNo) = vbYes Then
If CommandButton15.BackColor = RGB(255, 255, 0) Then CommandButton15.BackColor = RGB(255, 255, 255) Else CommandButton15.BackColor = RGB(255, 255, 0)
Range("A33").Value = 1 ' Dual Deck Accumulation
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
So I am just wondering if any of you pro's think there might be a better way of doing this.
Thanks
Private Sub CommandButton10_Click()
'
If MsgBox("Would you like to configure the 6020 Module?", vbYesNo) = vbYes Then
If CommandButton2.BackColor = RGB(255, 255, 0) Then CommandButton2.BackColor = RGB(255, 255, 255) Else CommandButton2.BackColor = RGB(255, 255, 0)
Range("A37").Value = 1 ' Opt. control panel, must pick always
If CommandButton8.BackColor = RGB(255, 255, 0) Then CommandButton8.BackColor = RGB(255, 255, 255) Else CommandButton8.BackColor = RGB(255, 255, 0)
Range("A11").Value = 1 ' Operational Manual
If CommandButton9.BackColor = RGB(255, 255, 0) Then CommandButton9.BackColor = RGB(255, 255, 255) Else CommandButton9.BackColor = RGB(255, 255, 0)
Range("A9").Value = 1 ' Parts List Manual
If CommandButton5.BackColor = RGB(255, 255, 0) Then CommandButton5.BackColor = RGB(255, 255, 255) Else CommandButton5.BackColor = RGB(255, 255, 0)
Range("A17").Value = 1 ' Base Folder
'
If MsgBox("Is this an Enduro configuration?", vbYesNo) = vbYes Then
If CommandButton7.BackColor = RGB(255, 255, 0) Then CommandButton7.BackColor = RGB(255, 255, 255) Else CommandButton7.BackColor = RGB(255, 255, 0)
Range("A25").Value = 1 ' Cable Kit
'
If MsgBox("Would you like HEAVY ROLLERS?", vbYesNo) = vbYes Then
If CommandButton6.BackColor = RGB(255, 255, 0) Then CommandButton6.BackColor = RGB(255, 255, 255) Else CommandButton6.BackColor = RGB(255, 255, 0)
Range("A21").Value = 1 ' Rollers - Sure Grip Folder
If CommandButton26.BackColor = RGB(255, 255, 0) Then CommandButton26.BackColor = RGB(255, 255, 255) Else CommandButton26.BackColor = RGB(255, 255, 0)
Range("A53").Value = 1 ' Rework rollers for heavy fold
'
If MsgBox("Did the customer order extra HEAVY fold plates?", vbYesNo) = vbYes Then
If CommandButton23.BackColor = RGB(255, 255, 0) Then CommandButton23.BackColor = RGB(255, 255, 255) Else CommandButton23.BackColor = RGB(255, 255, 0)
Range("A57").Value = 1 ' HEAVY Fold Plate #4
If CommandButton24.BackColor = RGB(255, 255, 0) Then CommandButton24.BackColor = RGB(255, 255, 255) Else CommandButton24.BackColor = RGB(255, 255, 0)
Range("A55").Value = 1 ' HEAVY Fold Plate #1
'
If MsgBox("Did the customer order extra MEDIUM fold plates?", vbYesNo) = vbYes Then
If CommandButton21.BackColor = RGB(255, 255, 0) Then CommandButton21.BackColor = RGB(255, 255, 255) Else CommandButton21.BackColor = RGB(255, 255, 0)
Range("A63").Value = 1 ' Medium Fold Plate #4
If CommandButton22.BackColor = RGB(255, 255, 0) Then CommandButton22.BackColor = RGB(255, 255, 255) Else CommandButton22.BackColor = RGB(255, 255, 0)
Range("A61").Value = 1 ' Medium Fold Plate #3
'
If MsgBox("Accumulation Required?", vbYesNo) = vbYes Then
If CommandButton14.BackColor = RGB(255, 255, 0) Then CommandButton14.BackColor = RGB(255, 255, 255) Else CommandButton14.BackColor = RGB(255, 255, 0)
Range("A29").Value = 1 ' Accumulation
'
If MsgBox("Do you require Single Accumulation?", vbYesNo) = vbYes Then
If CommandButton16.BackColor = RGB(255, 255, 0) Then CommandButton16.BackColor = RGB(255, 255, 255) Else CommandButton16.BackColor = RGB(255, 255, 0)
Range("A31").Value = 1 ' Single Deck Accumulation
'
If MsgBox("Do you require Dual Accumulation?", vbYesNo) = vbYes Then
If CommandButton15.BackColor = RGB(255, 255, 0) Then CommandButton15.BackColor = RGB(255, 255, 255) Else CommandButton15.BackColor = RGB(255, 255, 0)
Range("A33").Value = 1 ' Dual Deck Accumulation
End If
End If
End If
End If
End If
End If
End If
End If
End Sub