Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Worksheet_Change event not running from Form control.

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Worksheet_Change event not running from Form control.

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Worksheet_Change event not running from Form control.

JLG - If I understand correctly, you are running a macro when you select the
radio button - which in turn changes B3 - which in turn triggers the
Worksheet_Change event. Mine is set up a little differently in that I have
linked my 3 radio buttons (grouped) to cell C7. So when I push the first
radio button, C7 changes to 1, second and C7 = 2, third and C7 = 3. These
changes are not triggering the Worksheet_Change event though.
--
Brad E.

"JLGWhiz" wrote:

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Worksheet_Change event not running from Form control.

No, my setup is for the manual click of the radio button to change the value
in cell b3, which then triggers the message box. If you would post your
code, maybe we could help debug the problem.

"Brad E." wrote:

JLG - If I understand correctly, you are running a macro when you select the
radio button - which in turn changes B3 - which in turn triggers the
Worksheet_Change event. Mine is set up a little differently in that I have
linked my 3 radio buttons (grouped) to cell C7. So when I push the first
radio button, C7 changes to 1, second and C7 = 2, third and C7 = 3. These
changes are not triggering the Worksheet_Change event though.
--
Brad E.

"JLGWhiz" wrote:

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Worksheet_Change event not running from Form control.

If you are trying to change the value in the linked cell with the option
button, you could be cancelling you own value. The linked cell for an option
button only returns True or False, boolean results. You would need to use a
Target cell to activate the change event. I cannot determine much more
without seeing the relevant code.

"JLGWhiz" wrote:

No, my setup is for the manual click of the radio button to change the value
in cell b3, which then triggers the message box. If you would post your
code, maybe we could help debug the problem.

"Brad E." wrote:

JLG - If I understand correctly, you are running a macro when you select the
radio button - which in turn changes B3 - which in turn triggers the
Worksheet_Change event. Mine is set up a little differently in that I have
linked my 3 radio buttons (grouped) to cell C7. So when I push the first
radio button, C7 changes to 1, second and C7 = 2, third and C7 = 3. These
changes are not triggering the Worksheet_Change event though.
--
Brad E.

"JLGWhiz" wrote:

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Worksheet_Change event not running from Form control.

Sorry to keep second guessing you JLG, but in your first reply you posted
your OptionButton1_Click() coding, so we are still different. I am not
running a macro for the click of the radio button(s). I have right-clicked
on one of the three buttons Format Control Control tab Cell Link = $C$7
is how I am getting C7 to change. I also did a search in this forum before
my original post, and found only one other post which addressed the form
controls (with cell link) not running the Worksheet_Change event.
--
Brad E.


"JLGWhiz" wrote:

No, my setup is for the manual click of the radio button to change the value
in cell b3, which then triggers the message box. If you would post your
code, maybe we could help debug the problem.

"Brad E." wrote:

JLG - If I understand correctly, you are running a macro when you select the
radio button - which in turn changes B3 - which in turn triggers the
Worksheet_Change event. Mine is set up a little differently in that I have
linked my 3 radio buttons (grouped) to cell C7. So when I push the first
radio button, C7 changes to 1, second and C7 = 2, third and C7 = 3. These
changes are not triggering the Worksheet_Change event though.
--
Brad E.

"JLGWhiz" wrote:

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Worksheet_Change event not running from Form control.

OK, I think I understand now that you are trying to use the True/Fale value
of the option button as a trigger for the underlying Change event code. I
don't think that will work, because VBA sees the linked cell change as
similar to a calculation and a calculation will not trigger the change event.
I would not use the link, but instead use code behind the button similar to
how I set up the first test. That will trigger the change event.

"Brad E." wrote:

Sorry to keep second guessing you JLG, but in your first reply you posted
your OptionButton1_Click() coding, so we are still different. I am not
running a macro for the click of the radio button(s). I have right-clicked
on one of the three buttons Format Control Control tab Cell Link = $C$7
is how I am getting C7 to change. I also did a search in this forum before
my original post, and found only one other post which addressed the form
controls (with cell link) not running the Worksheet_Change event.
--
Brad E.


"JLGWhiz" wrote:

No, my setup is for the manual click of the radio button to change the value
in cell b3, which then triggers the message box. If you would post your
code, maybe we could help debug the problem.

"Brad E." wrote:

JLG - If I understand correctly, you are running a macro when you select the
radio button - which in turn changes B3 - which in turn triggers the
Worksheet_Change event. Mine is set up a little differently in that I have
linked my 3 radio buttons (grouped) to cell C7. So when I push the first
radio button, C7 changes to 1, second and C7 = 2, third and C7 = 3. These
changes are not triggering the Worksheet_Change event though.
--
Brad E.

"JLGWhiz" wrote:

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Worksheet_Change event not running from Form control.

Thanks, JLG. I wanted to stay away from that because I will end up with 36
radio buttons (12 sets of 3). I'll do what I have to.

Thanks again,
--
Brad E.


"JLGWhiz" wrote:

OK, I think I understand now that you are trying to use the True/Fale value
of the option button as a trigger for the underlying Change event code. I
don't think that will work, because VBA sees the linked cell change as
similar to a calculation and a calculation will not trigger the change event.
I would not use the link, but instead use code behind the button similar to
how I set up the first test. That will trigger the change event.

"Brad E." wrote:

Sorry to keep second guessing you JLG, but in your first reply you posted
your OptionButton1_Click() coding, so we are still different. I am not
running a macro for the click of the radio button(s). I have right-clicked
on one of the three buttons Format Control Control tab Cell Link = $C$7
is how I am getting C7 to change. I also did a search in this forum before
my original post, and found only one other post which addressed the form
controls (with cell link) not running the Worksheet_Change event.
--
Brad E.


"JLGWhiz" wrote:

No, my setup is for the manual click of the radio button to change the value
in cell b3, which then triggers the message box. If you would post your
code, maybe we could help debug the problem.

"Brad E." wrote:

JLG - If I understand correctly, you are running a macro when you select the
radio button - which in turn changes B3 - which in turn triggers the
Worksheet_Change event. Mine is set up a little differently in that I have
linked my 3 radio buttons (grouped) to cell C7. So when I push the first
radio button, C7 changes to 1, second and C7 = 2, third and C7 = 3. These
changes are not triggering the Worksheet_Change event though.
--
Brad E.

"JLGWhiz" wrote:

I put a radio button from the Control Tool Box on a sheet and put the code
below behind the sheet. I could not duplicate the problem. The option
button code triggered the change event each time.

Private Sub OptionButton1_Click()
If Range("B3") < 5 Then
Range("B3") = Range("B3").Value + 1
Else
Range("B3") = Range("B3").Value - 1
End If
Sheets(1).OptionButton1 = False
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B3") Then
MsgBox "Bingo"
End If
End Sub





"Brad E." wrote:

I have a Worksheet_Change event set up and running great when I change cell
C7. Then I set up three (Form) radio buttons linked to C7. When I push the
radio buttons, C7 is changing, but the Worksheet_Change event doesn't get
called anymore. I know I could also assign a macro to the Form, but I want
to end up with 12 sets of 3 radio buttons, linked to 12 individual cells. It
would be easy to keep "Target" useful since these 12 cells are all over the
spreadsheet.

Thanks.
--
Brad E.
Many thanks to the people answering questions.

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
Textbox added to Form at runtime too small, can't control size andchange event won't trigger RCGUA Excel Worksheet Functions 2 December 10th 08 09:34 PM
Textbox added to Form at runtime too small, can't control size andchange event won't trigger RCGUA Excel Worksheet Functions 0 December 10th 08 07:48 PM
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


All times are GMT +1. The time now is 08:53 AM.

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

About Us

"It's about Microsoft Excel"