Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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
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
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple problem excelnovice1 New Users to Excel 3 June 29th 06 11:19 AM
Simple problem? Foobi Excel Worksheet Functions 3 February 10th 06 10:24 PM
Simple problem inquirer Excel Discussion (Misc queries) 4 April 16th 05 12:37 PM
A simple problem... Chris Gorham[_3_] Excel Programming 2 December 24th 03 02:47 PM


All times are GMT +1. The time now is 10:48 PM.

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"