ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Easy Question about selecting Ranges (https://www.excelbanter.com/excel-programming/347492-re-easy-question-about-selecting-ranges.html)

Andibevan[_4_]

Easy Question about selecting Ranges
 
Many thanks

"Tom Ogilvy" wrote in message
...
You can only select on the activesheet.

An alternative approach
Sheets("Worksheet 1").Select
Range("A8").Select

if the workbook is not active

Workbooks("MyBook.xls").Select
Sheets("Worksheet 1").Select
Range("A8").Select

if you execute the code from within a class module such as a sheet module

or
the thisworkbook module
Workbooks("MyBook.xls").Select
Workbooks("MyBook.xls").Sheets("Worksheet 1").Select
Workbooks("MyBook.xls").Sheets("Worksheet 1").Range("A8").Select

as any unqualified references will be qualified with the sheet or workbook
associated with that module.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
Hi All,

This is a really basic question that I can't work out.

Why can't I use sheets("Worksheet 1").Range("A8").Select to select a

range
on another worksheet?

And am I correct in thinking the only way to do it is:-

Application.Goto Activeworkbook.Sheets("Worksheet 1").Range("A8")

Thanks in advance

Andi








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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com