View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default sheet code problem

Because Range("A1").Select refers to the sheet containing the code, which
isn't the activesheet at that time

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Sheets("Sheet2").Select
Sheets("Sheet2").Range("A1").Select
End Sub

--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
with the following procedure entered into the sheet code of "Sheet1" the
method fails why?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Sheets("Sheet2").Select
Range("A1").Select
End Sub


I can enter the above code into a normal macro in a normal module then

call
that sub fro the sheet code. but that seems daft, why doesn't it work
directly?



stuart