Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
have some problem with database | Excel Discussion (Misc queries) | |||
Urgent Help Required on Excel Macro Problem | Excel Discussion (Misc queries) | |||
Problem With Reference Update | Excel Worksheet Functions | |||
Copy an Drag cell Formula Problem | Excel Discussion (Misc queries) | |||
Freeze Pane problem in shared workbooks | Excel Discussion (Misc queries) |