Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default second worksheet change

Hi
Is it possible to have ore than one private sub worksheet_change?
I have written following code
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Range("a1:a100"), Target) Is Nothing Then
ActiveCell.Offset(0, 4).Select
Else
End If
End Sub
which works fine but I would also like to select activecell.offset(0,2)
when target range is ("e1:e100")
The reason being one value entered into cell in first range("a1:a100") tabs
to column E then I would like after value entered in this cell tab to column G
Hope this makes sense
Thanks in advance for any ideas
Tina

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default second worksheet change

Tina,
This will do what you want - you can do multiple tests for
insersection in the one routine.


Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Range("a1:a100"), Target) Is Nothing Then
ActiveCell.Offset(0, 4).Select
Else
If Not Application.Intersect(Range("E1:E100"), Target) Is Nothing Then
ActiveCell.Offset(0, 2).Select
End If
End If
End Sub

HTH

"tina" wrote:

Hi
Is it possible to have ore than one private sub worksheet_change?
I have written following code
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Range("a1:a100"), Target) Is Nothing Then
ActiveCell.Offset(0, 4).Select
Else
End If
End Sub
which works fine but I would also like to select activecell.offset(0,2)
when target range is ("e1:e100")
The reason being one value entered into cell in first range("a1:a100") tabs
to column E then I would like after value entered in this cell tab to column G
Hope this makes sense
Thanks in advance for any ideas
Tina

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default second worksheet change

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Range("a1:a100"), Target) Is Nothing Then
Target.Offset(0, 4).Select
Elseif Not Application.Intersect(Range("E1:E100"),Target) is Nothing then
Target.Offset(0,2).Select
End If
End Sub



--
Regards,
Tom Ogilvy

"tina" wrote in message
...
Hi
Is it possible to have ore than one private sub worksheet_change?
I have written following code
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Range("a1:a100"), Target) Is Nothing Then
ActiveCell.Offset(0, 4).Select
Else
End If
End Sub
which works fine but I would also like to select activecell.offset(0,2)
when target range is ("e1:e100")
The reason being one value entered into cell in first range("a1:a100")

tabs
to column E then I would like after value entered in this cell tab to

column G
Hope this makes sense
Thanks in advance for any ideas
Tina



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 to change the pivot chart automaticaly as values in the worksheet change Vinay Vasu Excel Worksheet Functions 0 May 3rd 10 04:25 PM
change formula in a shared worksheet without losing change history DCE Excel Worksheet Functions 5 July 25th 08 01:37 PM
Change to Worksheet Change Event Steph[_6_] Excel Programming 2 October 19th 05 03:42 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM


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