Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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




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
CODE PROBLEM N.F[_2_] Excel Discussion (Misc queries) 2 June 15th 07 08:07 PM
VB code to copy sheet format to another sheet ASU Excel Discussion (Misc queries) 12 August 10th 06 02:37 AM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM
Problem pasting a row from a hidden sheet to the first free row on another visible sheet Didier Poskin Excel Programming 2 January 10th 04 01:18 AM
unprotect sheet in code and make sheet visible peach255 Excel Programming 1 August 1st 03 03:28 AM


All times are GMT +1. The time now is 04:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"