Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Recognizing cell change in a Sub Worksheet_Change procedure

Does the worksheet_change event fire when you manually copy and paste?

In any case you can directly call teh worksheet_change procedure from your
copy paste macro if need be.
--
JNW


"AMY Z." wrote:

Hi,
The procedure below works great if I manually enter a value in A1. I have
another macro that copies and pastes a certain row into row1. The procedure
below won't change if I run the copy and paste macro, even though A1 has
changed.
Is there a way around this so the code below recognizes a change by copy and
pasting?

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" Then
With Worksheets("Sheet2")
.Rows("1:35").EntireRow.Hidden = False
If Target.Text = "Apples" Then
.Rows("10:10").EntireRow.Hidden = True
.Rows("20:20").EntireRow.Hidden = True
ElseIf Target.Text = "Pears" Then
.Rows("15:15").EntireRow.Hidden = True
.Rows("25:25").EntireRow.Hidden = True
ElseIf Target.Text = "Oranges" Then
.Rows("30:30").EntireRow.Hidden = True
.Rows("35:35").EntireRow.Hidden = True
Else
.Rows("12:12").EntireRow.Hidden = True
.Rows("16:16").EntireRow.Hidden = True
End If
End With
End If
End Sub

I hope I explained so you can understand.
Thank you your time in advance,
Amy

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
Worksheet_Change procedure question Grant Excel Programming 0 September 28th 04 08:41 PM
Worksheet_Change procedure [email protected] Excel Programming 0 September 3rd 04 02:08 AM
Worksheet_Change procedure [email protected] Excel Programming 1 September 3rd 04 01:53 AM
Worksheet_Change procedure [email protected] Excel Programming 1 September 3rd 04 01:48 AM
Worksheet_Change procedure [email protected] Excel Programming 1 September 3rd 04 01:23 AM


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

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"