Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tjh tjh is offline
external usenet poster
 
Posts: 96
Default Change Event

Hello,

I would like a macro to run when a specific range of cells are changed, but
I do not want it to run if any other cells are changed. For instance if any
cell in the range A1:A25 are change I would like the macro to run. But I do
not want it to run if any other cell on the worksheet is changed. Is this
possible?

Thank you,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Change Event

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 and Target.Row < 26 Then
<Perform Macro
End If
End Sub

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"tjh" wrote in message
...
Hello,

I would like a macro to run when a specific range of cells are changed,
but
I do not want it to run if any other cells are changed. For instance if
any
cell in the range A1:A25 are change I would like the macro to run. But I
do
not want it to run if any other cell on the worksheet is changed. Is this
possible?

Thank you,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Change Event

What should happen if the user changes a range of cells, some in and some
out of the specific range? Say by pasting to A20:A30 or selecting A1:B10,
C5:D15, A18:A22 typing an entry and pressing Ctrl-Enter?

--
Jim
"tjh" wrote in message
...
| Hello,
|
| I would like a macro to run when a specific range of cells are changed,
but
| I do not want it to run if any other cells are changed. For instance if
any
| cell in the range A1:A25 are change I would like the macro to run. But I
do
| not want it to run if any other cell on the worksheet is changed. Is this
| possible?
|
| Thank you,


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Change Event

That is where Target.Rows.Count with Target.Row will need to be taken into
account. This is also true for Target.Columns.Count with Target.Column.

However, this could be a problem as if multiple different range selections
is selected, then a value typed in, then pressed Ctrl-Enter, which case
would also require using Target.Areas, such as

If Target.Areas.Count1 Then
'There are multiple range areas selected.
Else
'There is only one area selected.
End If

Such example of multiple areas would be like if A5:B8, A11:A15, C8:F24 were
all selected and the only cells selected, then the user typed in something
like the numeric value of "0", then pressed Ctrl-Enter.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Jim Rech" wrote in message
...
What should happen if the user changes a range of cells, some in and some
out of the specific range? Say by pasting to A20:A30 or selecting A1:B10,
C5:D15, A18:A22 typing an entry and pressing Ctrl-Enter?

--
Jim
"tjh" wrote in message
...
| Hello,
|
| I would like a macro to run when a specific range of cells are changed,
but
| I do not want it to run if any other cells are changed. For instance if
any
| cell in the range A1:A25 are change I would like the macro to run. But I
do
| not want it to run if any other cell on the worksheet is changed. Is
this
| possible?
|
| Thank you,




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
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
Change event and calculate event Antje Excel Programming 1 March 29th 05 09:03 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM


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