What is wrong?

Jonasraf

New Member
Joined
Jun 19, 2007
Messages
40
Sub CheckBox1_Click()

If CheckBox1.Value = True Then
Application.ScreenUpdating = False
Worksheets("Data").Range("b37").Select
ActiveCell.Value = -14
Worksheets("WogB").Select
Range("b34").Select
Application.ScreenUpdating = True
End If



If CheckBox1.Value = False Then
Application.ScreenUpdating = False
Worksheets("Data").Select
Range("b37").Select
ActiveCell.Value = 0
Worksheets("WogB").Select
Range("b34").Select
Application.ScreenUpdating = True
End If

End Sub

I cannot see what is wrong. When I click the checkbox. Nothing happens. Not even a error appears. I have also tried to use
ActiveCell.FormulaR1C1 = -14


Help please.

Regards,
Jonas
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try this

Sub CheckBox1_Click()

If CheckBox1.Value = True Then
Application.ScreenUpdating = False
Worksheets("Data").Range("b37").Select
ActiveCell.Value = -14
Worksheets("WogB").Select
Range("b34").Select
Application.ScreenUpdating = True else

If CheckBox1.Value = False Then
Application.ScreenUpdating = False
Worksheets("Data").Select
Range("b37").Select
ActiveCell.Value = 0
Worksheets("WogB").Select
Range("b34").Select
Application.ScreenUpdating = True
End If

End Sub
 
Upvote 0
No need to do all that selecting, but is the checkbox on a worksheet and if so which sheet?
 
Upvote 0
Try this:

Code:
Private Sub CheckBox1_Click()
Worksheets("Data").Range("B37") = 14 * CheckBox1.Value
Range("B34").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,554
Messages
6,114,280
Members
448,562
Latest member
Flashbond

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