Worksheet_Range Problem

G

Guest

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
 
B

Bernie Deitrick

CWillis

Start with

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

Guest

Thank you very much Bernie.

Bernie Deitrick said:
CWillis

Start with

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

Bernie Deitrick

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

Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top