View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
zSplash zSplash is offline
external usenet poster
 
Posts: 28
Default Using Target.Row in other Sheets

Outstanding, Tom! Thanks so much.

st.

"Tom Ogilvy" wrote in message
...

You can only select on the activesheet.

On Error goto ErrHandler
Dim sh as Worksheet
Dim sAddr as String
if Target.Count 1 then exit sub
If Target.Column = 1 And Target.Value < "" Then
sAddr = target.Address
Application.ScreenUpdating = False
Application.EnableEvents = False
for each sh in worksheets(Array("sheet2","Sheet3","Sheet4","Sheet 5"))
sh.Activate
sh.Range(sAddr).Select
Next
me.activate

End if
ErrHandler
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy




"zSplash" <zNOSPAMSplash@ gci.net wrote in message
...
I am trying to select cells in several sheets, if the user is in Sheet1

and
selects a cell in column A. I get a '1004' error ("Select method of

Range
class failed") at Range("A" & Target.Row).Select. Can somebody help me?
Here is my code:

... If Target.Cells.Count = 1 Then
1: ' if they select a cell in Col 1, select complementary cell in

other
sheets
If Target.Column = 1 And Target.Value < "" Then
Sheets(3).Select
Range("A" & Target.Row).Select
Sheets(4).Range("A" & Target.Row).Sheets(5).Select
Sheets(1).Select
EndIf
EndIf
...

TIA