Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change event and calculate event

Hello,
I have a spreadsheet with nine option buttons from the Forms toolbar. All of
them are linked to the same cell, P6. I also have a chart that displays one
of nine data ranges (which are all stored on a separate sheet in the same
workbook), depending on which option button is selected.
The twist to this is that the data ranges can be one of two number formats,
plain number or percentage. Thus, I entered some code in VBA to change that
number format accordingly. I placed the code in the Worksheet_change event,
hoping that the changing of the value in the linked cell would trigger that
event. This did not occur. Then, I placed my code in the Worksheet_calculate
event, which worked. However, on certain actions, e.g. selecting an entire
row and deleting it, Excel hangs and I can only forcefully exit Excel.
Why does it do that? Any suggestions/solutions? Also, is there a way to
trigger the change event even though I am using Excel controls rather than
ActiveX controls?
Is there another way to accomplish that without having to use ActiveX
controls?
Apologies for the lengthy explanation.
Any help is greatly appreciated.
TIA,
BR,
Antje Crawford
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Change event and calculate event

You can call the change event the same as you would call any other procedure.
The only trick is that the argument is a range object "Target"

call worksheet_change(sheet1.range("A1"))

HTH

"Antje" wrote:

Hello,
I have a spreadsheet with nine option buttons from the Forms toolbar. All of
them are linked to the same cell, P6. I also have a chart that displays one
of nine data ranges (which are all stored on a separate sheet in the same
workbook), depending on which option button is selected.
The twist to this is that the data ranges can be one of two number formats,
plain number or percentage. Thus, I entered some code in VBA to change that
number format accordingly. I placed the code in the Worksheet_change event,
hoping that the changing of the value in the linked cell would trigger that
event. This did not occur. Then, I placed my code in the Worksheet_calculate
event, which worked. However, on certain actions, e.g. selecting an entire
row and deleting it, Excel hangs and I can only forcefully exit Excel.
Why does it do that? Any suggestions/solutions? Also, is there a way to
trigger the change event even though I am using Excel controls rather than
ActiveX controls?
Is there another way to accomplish that without having to use ActiveX
controls?
Apologies for the lengthy explanation.
Any help is greatly appreciated.
TIA,
BR,
Antje Crawford

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
AFTER Calculate Event PosseJohn Excel Programming 4 January 16th 05 07:31 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 07:42 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"