View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] kblount.epsilon@gmail.com is offline
external usenet poster
 
Posts: 1
Default check boxes in Excel - VBA Question

I am attempting to have Excel change a formula based on the status of a
check box contained on a sheet. The code I have is the following:

Private Sub CheckBoxFULL_Change()

Application.ScreenUpdating = False

Select Case CheckBoxFULL.Value

Case True

Sheets("CAL-SHEET").Select
Range("F36").Select
ActiveCell.FormulaR1C1 = "='Line Fit FULL CURVE'!RC[-4]"
Worksheets("Line Fit FULL CURVE").Activate
Range("B36").Select

Case False

Sheets("CAL-SHEET").Select
Range("F36").Select
ActiveCell.FormulaR1C1 = "=R[-23]C[24]"
Worksheets("Line Fit FULL CURVE").Activate
Range("B36").Select

End Select

Sheets("CAL-SHEET").Select

Application.ScreenUpdating = True

End Sub

But I keep getting:

Run-time error '1004'
Select method of Range class failed

on the "Range("F36").Select" line. Why is this not functioning
correctly? If I copy the code to a plain macro, it performs everything
correctly, but when running it as I do above, it errors out.

Thanks for any help/guidance!

Ken