Help with check box

HDfatboy03

Board Regular
Joined
May 23, 2010
Messages
62
Hello

Need help with check boxes. I have the following statement, the check box return's "TRUE" when selected but does not return "FALSE" when NOT selected and I need it turn return "FALSE" when not selected.

Below is the code I am using. What am I missing?

<Start Code>

'START box buttons for FAIRWAYS HIT H E R E
'copy the NEW DATA FAIRWAYS HIT to database
If FH1 = True Then
ws.Cells(iRow, 42).Value = FH1.Value
ws2.Cells(9, "C").Value = FH1.Value
End If

<End Code>

Thanks for any assistance or suggestion

HDfatboy03
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
How did you create your Checkboxes? Using Forms Toolbar or Active-X toolbox?
 
Upvote 0
Perhaps

Code:
'START box buttons for FAIRWAYS HIT H E R E
'copy the NEW DATA FAIRWAYS HIT to database
Select Case FH1
Case True:  ws.Cells(iRow, 42).Value = FH1.Value
            ws2.Cells(9, "C").Value = FH1.Value
Case False:
End Select
 
Upvote 0
Take out the IF function...

'START box buttons for FAIRWAYS HIT H E R E
'copy the NEW DATA FAIRWAYS HIT to database
ws.Cells(iRow, 42).Value = FH1.Value
ws2.Cells(9, "C").Value = FH1.Value
 
Upvote 0
Jim

Thanks for the help ... its working now. Now my formula is not working,

=COUNTA(C10:K10)

I need my formula to COUNT the "TRUE" in that range. Do you have any suggestions?

Thanks for your help

HDfatboy03
 
Upvote 0
Maybe try...
=COUNTIF(C10:K10, TRUE)

or

=SUM(C10:K10)

assuming all the cells in C10:K10 are true or false (1 or 0)
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

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