Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default Worksheet_Range Problem

The following code currently updates the page when anything on the page is
changed. I would like for it to update only when something in cells G27:J27
is changed. (G27:J27 are merged into one cell.) Any ideas? Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "G27"

Application.EnableEvents = False
If Range("G27").Value = "Other" Then
Macro1
ElseIf Range("G27").Value = "WSW" Then
Macro2
Else: Macro3

End If
Application.EnableEvents = True

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick
 
Posts: n/a
Default Worksheet_Range Problem

CWillis

Start with

If Target.Cells.Count 1 Then Exit Sub
If Intersect(Range("G27"), Target) Is Nothing Then Exit Sub

--
HTH,
Bernie
MS Excel MVP


"CWillis" wrote in message
...
The following code currently updates the page when anything on the page is
changed. I would like for it to update only when something in cells G27:J27
is changed. (G27:J27 are merged into one cell.) Any ideas? Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "G27"

Application.EnableEvents = False
If Range("G27").Value = "Other" Then
Macro1
ElseIf Range("G27").Value = "WSW" Then
Macro2
Else: Macro3

End If
Application.EnableEvents = True

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default Worksheet_Range Problem

Thank you very much Bernie.

"Bernie Deitrick" wrote:

CWillis

Start with

If Target.Cells.Count 1 Then Exit Sub
If Intersect(Range("G27"), Target) Is Nothing Then Exit Sub

--
HTH,
Bernie
MS Excel MVP


"CWillis" wrote in message
...
The following code currently updates the page when anything on the page is
changed. I would like for it to update only when something in cells G27:J27
is changed. (G27:J27 are merged into one cell.) Any ideas? Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "G27"

Application.EnableEvents = False
If Range("G27").Value = "Other" Then
Macro1
ElseIf Range("G27").Value = "WSW" Then
Macro2
Else: Macro3

End If
Application.EnableEvents = True

End Sub




  #4   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick
 
Posts: n/a
Default Worksheet_Range Problem

You're quite welcome... Gald to hear that it seems to have worked for you...

Bernie
MS Excel MVP


Thank you very much Bernie.



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
have some problem with database baldamenti Excel Discussion (Misc queries) 1 October 13th 05 05:38 PM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
Problem With Reference Update Egon Excel Worksheet Functions 17 July 16th 05 05:45 AM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 01:04 AM


All times are GMT +1. The time now is 09:08 AM.

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"