Message Boxes

Harley78

Active Member
Joined
Sep 27, 2007
Messages
372
Office Version
  1. 365
Platform
  1. 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
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I was thinking that, but I do have a visio drawing (imported into excel) with command buttons which would probably duplicate this some fashion. However, the configuration is basically a yes no reply and was thinking that a user form would do it, but don't have a clue on how the option (yes/no) would work.
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,520
Members
448,968
Latest member
Ajax40

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top