User Form Check Box Data Entry Multi Options

raccoon588

Board Regular
Joined
Aug 5, 2016
Messages
118
I have a user form with three options. I need to be able to select 1 of the options, two of them, or all three. i have the following code but if the first if statement is not true it does not work at all. how do i get it to allow for any selection combination at any time to work?



Code:
Private Sub CmdSubmit_Click()


Dim c As Range
If ChkPlantManager Then
Set c = Range("A5:A9999").Find(Date).Offset(1, 24)
If Not c Is Nothing Then c.Select
ActiveCell.Value = "Plant Manager"
If ChkPLM Then
Set c = Range("A5:A9999").Find(Date).Offset(2, 24)
If Not c Is Nothing Then c.Select
ActiveCell.Value = "Plant Line Manager"
If ChkForeman Then
Set c = Range("A5:A9999").Find(Date).Offset(3, 24)
If Not c Is Nothing Then c.Select
ActiveCell.Value = "Foreman"
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
Try
Code:
Private Sub CmdSubmit_Click()


Dim c As Range
If ChkPlantManager Then
   Set c = Range("A5:A9999").find(Date).Offset(1, 24)
   If Not c Is Nothing Then c.Select
   activecell.Value = "Plant Manager"
End If
If ChkPLM Then
   Set c = Range("A5:A9999").find(Date).Offset(2, 24)
   If Not c Is Nothing Then c.Select
   activecell.Value = "Plant Line Manager"
End If
If ChkForeman Then
   Set c = Range("A5:A9999").find(Date).Offset(3, 24)
   If Not c Is Nothing Then c.Select
   activecell.Value = "Foreman"
End If
End Sub
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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