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:office:office" /><o:p></o:p>


Any assistance will be greatly appreciated

Thanks in advance

Bob
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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