Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple problem, must be too early...
The Select method is failing below, not sure what I am doing wrong. My goal
is to synchronize the selection across several sheets. I am using "SelectionChange" event to fire little code below. Thanks in advance for help. Public rwSelect as integer Sub Sync_Sheets() Dim rng As Range rwSelect = Selection.Row Set rng = Sheets(2).Range("C" & rwSelect) rng.Select Sheets(14).Activate End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple problem, must be too early...
You have to select or activate a sheet to change its selection.
Sub Sync_Sheets() Dim mySht As Worksheet Dim rwSelect As Long rwSelect = Selection.Cells(1).Row Application.ScreenUpdating = False For Each mySht In Worksheets mySht.Select Range("C" & rwSelect).Select Next mySht Sheets(14).Activate Application.ScreenUpdating = True End Sub HTH, Bernie MS Excel MVP "AD108" wrote in message ... The Select method is failing below, not sure what I am doing wrong. My goal is to synchronize the selection across several sheets. I am using "SelectionChange" event to fire little code below. Thanks in advance for help. Public rwSelect as integer Sub Sync_Sheets() Dim rng As Range rwSelect = Selection.Row Set rng = Sheets(2).Range("C" & rwSelect) rng.Select Sheets(14).Activate End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple problem, must be too early...
Oops. I overlooked your use of the selection change event: Use
Application.EnableEvents = False and Application.EnableEvents = True to bracket your code.... HTH, Bernie MS Excel MVP "AD108" wrote in message ... The Select method is failing below, not sure what I am doing wrong. My goal is to synchronize the selection across several sheets. I am using "SelectionChange" event to fire little code below. Thanks in advance for help. Public rwSelect as integer Sub Sync_Sheets() Dim rng As Range rwSelect = Selection.Row Set rng = Sheets(2).Range("C" & rwSelect) rng.Select Sheets(14).Activate End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple problem, must be too early...
Make sure Sheets(20 is Active when you hit
rng.Select -- Gary''s Student gsnu200709 "AD108" wrote: The Select method is failing below, not sure what I am doing wrong. My goal is to synchronize the selection across several sheets. I am using "SelectionChange" event to fire little code below. Thanks in advance for help. Public rwSelect as integer Sub Sync_Sheets() Dim rng As Range rwSelect = Selection.Row Set rng = Sheets(2).Range("C" & rwSelect) rng.Select Sheets(14).Activate End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple problem | New Users to Excel | |||
Simple problem? | Excel Worksheet Functions | |||
Simple problem | Excel Discussion (Misc queries) | |||
A simple problem... | Excel Programming |