Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
John Duffus
 
Posts: n/a
Default Addressing cells on inactive sheets

Hi,

I 'm still using Excel 97 and have this sub in a module.

Public Sub CellsOnInactiveSheet()
With Sheets("Sheet1")
.Range(.Range("A1"), .Range("B2")).Select
End With
End Sub

If any sheet except Sheet1 is active this produces an error.
I would have thought with a fully qualified address it should work with any
sheet active.

I don't really want to activate the sheet if I can help it.
Any help appreciated, thanks,
John Duffus


  #2   Report Post  
Jim May
 
Posts: n/a
Default Addressing cells on inactive sheets

Perhaps the .Select property cannot cross-over sheets;
it is restricted to only the sheet where code is running.


"John Duffus" wrote in message
news:g%s6f.259490$1i.7890@pd7tw2no...
Hi,

I 'm still using Excel 97 and have this sub in a module.

Public Sub CellsOnInactiveSheet()
With Sheets("Sheet1")
.Range(.Range("A1"), .Range("B2")).Select
End With
End Sub

If any sheet except Sheet1 is active this produces an error.
I would have thought with a fully qualified address it should work with
any sheet active.

I don't really want to activate the sheet if I can help it.
Any help appreciated, thanks,
John Duffus




  #4   Report Post  
John Duffus
 
Posts: n/a
Default Addressing cells on inactive sheets

Thanks Jim,
I can use the same addressing to read the range into an
array, regardless of which sheet is active, so it is my use of the Select
property that seems to be the problem.
John Duffus

"Jim May" wrote in message
news:Rtt6f.5059$AO5.1394@dukeread01...
Perhaps the .Select property cannot cross-over sheets;
it is restricted to only the sheet where code is running.


"John Duffus" wrote in message
news:g%s6f.259490$1i.7890@pd7tw2no...
Hi,

I 'm still using Excel 97 and have this sub in a module.

Public Sub CellsOnInactiveSheet()
With Sheets("Sheet1")
.Range(.Range("A1"), .Range("B2")).Select
End With
End Sub

If any sheet except Sheet1 is active this produces an error.
I would have thought with a fully qualified address it should work with
any sheet active.

I don't really want to activate the sheet if I can help it.
Any help appreciated, thanks,
John Duffus






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
Merging cells in Excel 2003 Bob Excel Discussion (Misc queries) 1 October 19th 05 07:10 PM
trying to create an (almost) circular formula between cells and data validated cells with lists KR Excel Worksheet Functions 0 May 12th 05 07:21 PM
Unlocking Cells when a worksheet is protected... racmb1975 Excel Discussion (Misc queries) 2 May 3rd 05 08:57 PM
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) RICHARD Excel Worksheet Functions 1 March 15th 05 05:49 PM
Formula help for using a range of cells! Sukismomma Excel Worksheet Functions 5 January 27th 05 02:34 AM


All times are GMT +1. The time now is 03:36 AM.

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"