Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default optionbutton with worksheet change


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

--
ra
-----------------------------------------------------------------------
raw's Profile: http://www.excelforum.com/member.php...fo&userid=2831
View this thread: http://www.excelforum.com/showthread.php?threadid=52386

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default optionbutton with worksheet change

If Intersect(Target, Range("D9,D11")) Is Nothing Then Exit Sub


--
Regards,
Tom Ogilvy


"raw" wrote in message
...

Hi guys

I have a work sheet with 2 input cells (for sizes) and about 6
optionbuttons in pairs i am using the code (see below) but the problem
i have is that for the worksheet change event to work you need to input
into the cell (and this cell is writen in the code) and press return for
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 for
inches. Is there any way to change the code to make the code work with
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 thanks


--
raw
------------------------------------------------------------------------
raw's Profile:

http://www.excelforum.com/member.php...o&userid=28312
View this thread: http://www.excelforum.com/showthread...hreadid=523868



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
for each optionbutton masterphilch Excel Programming 1 September 21st 05 05:37 PM
optionbutton benb Excel Programming 1 March 29th 05 09:41 PM
optionbutton takes two clicks to change value Will Gardner Excel Programming 2 December 1st 04 03:00 PM
Better Way to Use OptionButton [email protected] Excel Programming 0 September 1st 04 07:18 PM
Can't dynamically add withevents OptionButton to worksheet onedaywhen Excel Programming 6 August 27th 03 09:11 AM


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"