Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Easy question

Hi there,
Can you tell when one has to reference a cell by the spreadsheet name it
belongs to and when it is not required?

Calling this sub from Sheet1
Sub Button1
Worksheets("Sheet2").Activate
Range("A3").Select
End
Return Range("A3") from Sheet1

#1: Is the solution to use Worksheets("Sheet2").Range("A3")?
#2: Is the solution to use use named range (unique for the workbook) for
Worksheets("Sheet2").Range("A3") and then reference this name directly

Thanks
Ben
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Easy question

You have to reference the sheet as well when the sheet that you want is not
the active sheet, or that you don't know it is the active sheet. It is
probably good practice to always use a sheet reference.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"londono001" wrote in message
...
Hi there,
Can you tell when one has to reference a cell by the spreadsheet name it
belongs to and when it is not required?

Calling this sub from Sheet1
Sub Button1
Worksheets("Sheet2").Activate
Range("A3").Select
End
Return Range("A3") from Sheet1

#1: Is the solution to use Worksheets("Sheet2").Range("A3")?
#2: Is the solution to use use named range (unique for the workbook) for
Worksheets("Sheet2").Range("A3") and then reference this name directly

Thanks
Ben



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
Easy Question - Please help martinbarnes Excel Discussion (Misc queries) 2 March 6th 08 04:34 PM
Easy Question Bob[_8_] Excel Worksheet Functions 9 July 14th 07 03:50 PM
If - easy question mldancing Excel Discussion (Misc queries) 5 March 28th 07 01:26 PM
Easy Question dok112[_40_] Excel Programming 2 July 20th 05 11:48 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM


All times are GMT +1. The time now is 07:31 PM.

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"