Help with check boxes

HDfatboy03

Board Regular
Joined
May 23, 2010
Messages
62
Hello ... I have a working form and I want to ad check boxes to answer a simple question yes or no.


This is what I have so far

Private Sub UserForm_Click()
Private Sub cmdAdd3_Click()
Dim iRow As Long
Dim ws, ws2 As Worksheet
'Dim ws As Worksheet
Set ws = Worksheets("CoursesDB")
Set ws2 = Worksheets("CurDB")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtPart.Value) = "" Then
Me.txtPart.SetFocus
MsgBox "Please enter a Course Name"
Exit Sub
End If

'copy the data to the databases
ws.Cells(iRow, 1).Value = Me.txtPart.Value
ws2.Cells(4, "C").Value = Me.txtPart.Value

'Here is the part ... check box where I need assistance ... I want the information to go to ws and to (iRow, 114)
If ws.CheckBox1 = True Then
MsgBox "True" ws.Cells(iRow, 114)
Else
MsgBox "False" ws.Cells(iRow, 114)


'D E L E T E T H E F O R M STARTS HERE
'clear the data
Me.txtPart.Value = ""


Me.txtPart.SetFocus
End Sub

End If<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>


Any assistance will be greatly appreciated

Thanks in advance

Bob
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try something like this...
Code:
ws.Cells(irow, 114).Value = IIf(CheckBox1.Value, "yes", "no")
 
Upvote 0
THANKS for the all the help and suggestions ... here is what is working

If GH1 = True Then
ws.Cells(iRow, 114).Value = Me.GH1.Value
ws2.Cells(13, "C").Value = Me.GH1.Value
End If
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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