optionbutton with worksheet change

R

raw

Hi guys

I have a work sheet with 2 input cells (for sizes) and about
optionbuttons in pairs i am using the code (see below) but the proble
i have is that for the worksheet change event to work you need to inpu
into the cell (and this cell is writen in the code) and press return fo
the change event to work but in D11 i have this formula
=IF(D8="mm",D9,IF(D8="in",D9*25.4)) mm for millmeters and in fo
inches. Is there any way to change the code to make the code work wit
D11 even if the iput cell is in fact D9

Many thanks

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("D11")) Is Nothing Then Exit Sub
Dim check As Boolean
check = Range("D11") > 6500

With OptionButton10
.Enabled = check
.Value = check
End With

With OptionButton9
.Value = Not check
End With

End Sub
Private Sub OptionButton9_Click()
If Sheets("b28pricing").Range("D11") > 6500 Then
OptionButton10.Enabled = False
OptionButton10.Value = False
OptionButton9.Value = True
Else
OptionButton10.Enabled = True
End If


Private Sub OptionButton10_Click()
If Sheets("b28pricing").Range("D11") < 6499 Then
OptionButton10.Enabled = True
OptionButton10.Value = True
OptionButton9.Value = False
Else
OptionButton10.Enabled = False
End If

Many thank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top