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
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,384
Try something like this...
Code:
ws.Cells(irow, 114).Value = IIf(CheckBox1.Value, "yes", "no")
 

HDfatboy03

Board Regular
Joined
May 23, 2010
Messages
62
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,442
Messages
5,601,695
Members
414,469
Latest member
Murrell78

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
Top