Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Can Worksheet_Change call itself?

Hi,

In my Worksheet_Change event, I would like to change a cell and call the
Worksheet_Change event again.

In B3, the user enters a number up to 9, to access up to 9 vehicles. If the
old value was 3 and the user enters 5, then the Worksheet_Change acknowledges
the change and Displays some check boxes (Visible = True) for the 4th and 5th
column. The check boxes were hidden when B3 originally went smaller than 5
(Visible = False). The ability to use these check boxes also depends on the
entry in row 16. So first, I make the check boxes for vehicles 4 and 5
visible, and then want to re-enter the entry in row 16 for these 2 vehicles.
I thought if I just set a cell to a value, it would initiate the
Worksheet_Change event and the new Target would be the cell in row 16.

In a For loop (For X = 4 to 5, in this case), I have
Range("A16").Offset(0, X).Value = Range("A16").Offset(0, X).Value

Part of my Worksheet_Change event includes an intersection of Target and
"B16:J16", however the code after this intersection is not running.

What are my options to be able to run the code?
--
Thanks, Brad E.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Can Worksheet_Change call itself?

It works if I don't disable the "EnableEvents" at the beginning of the
Worksheet_Change code.
--
Brad E.


"Brad E." wrote:

Hi,

In my Worksheet_Change event, I would like to change a cell and call the
Worksheet_Change event again.

In B3, the user enters a number up to 9, to access up to 9 vehicles. If the
old value was 3 and the user enters 5, then the Worksheet_Change acknowledges
the change and Displays some check boxes (Visible = True) for the 4th and 5th
column. The check boxes were hidden when B3 originally went smaller than 5
(Visible = False). The ability to use these check boxes also depends on the
entry in row 16. So first, I make the check boxes for vehicles 4 and 5
visible, and then want to re-enter the entry in row 16 for these 2 vehicles.
I thought if I just set a cell to a value, it would initiate the
Worksheet_Change event and the new Target would be the cell in row 16.

In a For loop (For X = 4 to 5, in this case), I have
Range("A16").Offset(0, X).Value = Range("A16").Offset(0, X).Value

Part of my Worksheet_Change event includes an intersection of Target and
"B16:J16", however the code after this intersection is not running.

What are my options to be able to run the code?
--
Thanks, Brad E.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Can Worksheet_Change call itself?

Actually, I will want to Re-enable events prior to changing the cell.
--
Brad E.

"Brad E." wrote:

It works if I don't disable the "EnableEvents" at the beginning of the
Worksheet_Change code.
--
Brad E.


"Brad E." wrote:

Hi,

In my Worksheet_Change event, I would like to change a cell and call the
Worksheet_Change event again.

In B3, the user enters a number up to 9, to access up to 9 vehicles. If the
old value was 3 and the user enters 5, then the Worksheet_Change acknowledges
the change and Displays some check boxes (Visible = True) for the 4th and 5th
column. The check boxes were hidden when B3 originally went smaller than 5
(Visible = False). The ability to use these check boxes also depends on the
entry in row 16. So first, I make the check boxes for vehicles 4 and 5
visible, and then want to re-enter the entry in row 16 for these 2 vehicles.
I thought if I just set a cell to a value, it would initiate the
Worksheet_Change event and the new Target would be the cell in row 16.

In a For loop (For X = 4 to 5, in this case), I have
Range("A16").Offset(0, X).Value = Range("A16").Offset(0, X).Value

Part of my Worksheet_Change event includes an intersection of Target and
"B16:J16", however the code after this intersection is not running.

What are my options to be able to run the code?
--
Thanks, Brad E.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Can Worksheet_Change call itself?

Sorry about the diatribe in my first reply.

Why do you not just implement a userform.

The useform could enter the data into the worksheet. If the selected
quantity is not
=<9 then you can hide the check boxes or renove the quantities. It will be
easier to use and restrict the user frm inputting the wrong values in the
wrong places.





"Brad E." wrote:

Actually, I will want to Re-enable events prior to changing the cell.
--
Brad E.

"Brad E." wrote:

It works if I don't disable the "EnableEvents" at the beginning of the
Worksheet_Change code.
--
Brad E.


"Brad E." wrote:

Hi,

In my Worksheet_Change event, I would like to change a cell and call the
Worksheet_Change event again.

In B3, the user enters a number up to 9, to access up to 9 vehicles. If the
old value was 3 and the user enters 5, then the Worksheet_Change acknowledges
the change and Displays some check boxes (Visible = True) for the 4th and 5th
column. The check boxes were hidden when B3 originally went smaller than 5
(Visible = False). The ability to use these check boxes also depends on the
entry in row 16. So first, I make the check boxes for vehicles 4 and 5
visible, and then want to re-enter the entry in row 16 for these 2 vehicles.
I thought if I just set a cell to a value, it would initiate the
Worksheet_Change event and the new Target would be the cell in row 16.

In a For loop (For X = 4 to 5, in this case), I have
Range("A16").Offset(0, X).Value = Range("A16").Offset(0, X).Value

Part of my Worksheet_Change event includes an intersection of Target and
"B16:J16", however the code after this intersection is not running.

What are my options to be able to run the code?
--
Thanks, Brad E.

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
Can Worksheet_Change call itself? Brad E. Excel Programming 0 February 17th 09 08:01 PM
Can Worksheet_Change call itself? Mike H Excel Programming 0 February 17th 09 07:49 PM
Call sub from worksheet_change JMJ Excel Programming 6 May 4th 08 02:38 AM
Call Worksheet_Change macro in another worksheet Freddy Excel Programming 6 October 29th 06 07:16 PM


All times are GMT +1. The time now is 05:20 PM.

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"