Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Using Worksheet_Change(ByVal Target As Range)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Les G - 11 Nov 2007 05:50 GMT
I would like to change the focus from the current worksheet to another when a
value in a specific range is changed.  This is an easy VB statement but I am
going round in circles... Please Help

Thanks

Les
OssieMac - 11 Nov 2007 06:53 GMT
Hi Les,

I'll be interested in seeing a better method if someone has one but this
works:-

'Only runs with Target in range B6:C8

If Target.Row >= 6 And Target.Row <= 8 _
   And Target.Column >= 2 And Target.Column <= 3 Then
   Sheets("Sheet2").Activate
End If

Regards,

OssieMac

> I would like to change the focus from the current worksheet to another when a
> value in a specific range is changed.  This is an easy VB statement but I am
[quoted text clipped - 3 lines]
>
> Les
JMB - 11 Nov 2007 06:53 GMT
Perhaps something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
 Sheet3.Activate
End If
End Sub

> I would like to change the focus from the current worksheet to another when a
> value in a specific range is changed.  This is an easy VB statement but I am
[quoted text clipped - 3 lines]
>
> Les
Les G - 11 Nov 2007 07:04 GMT
You are a star... I made a slight modification and it worked a dream...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
 Sheet3.Activate
End If
End Sub

Thanks very much

> Perhaps something like this:
>
[quoted text clipped - 11 lines]
> >
> > Les
JMB - 11 Nov 2007 16:32 GMT
you're welcome, thanks for posting back

> You are a star... I made a slight modification and it worked a dream...
>
[quoted text clipped - 21 lines]
> > >
> > > Les
Les G - 12 Nov 2007 10:29 GMT
Thank you from a wonderful day in sunny South Africa

> you're welcome, thanks for posting back
>
[quoted text clipped - 23 lines]
> > > >
> > > > Les
JMB - 13 Nov 2007 00:40 GMT
You're welcome from an overcast, dreary day in Illinois (U.S.)

> Thank you from a wonderful day in sunny South Africa
>
[quoted text clipped - 25 lines]
> > > > >
> > > > > Les
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.