ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   a reminder, please - Range w/out qualified reference (https://www.excelbanter.com/excel-programming/293169-reminder-please-range-w-out-qualified-reference.html)

joe

a reminder, please - Range w/out qualified reference
 
If I see the following in a line of code

Range(rangeName) = Int(iValue

Can I assume that this refers to a range in the activesheet

Joe

Frank Kabel

a reminder, please - Range w/out qualified reference
 
Hi Joe
yes

--
Regards
Frank Kabel
Frankfurt, Germany

Joe wrote:
If I see the following in a line of code:

Range(rangeName) = Int(iValue)

Can I assume that this refers to a range in the activesheet?

Joe


Jean-Yves[_2_]

a reminder, please - Range w/out qualified reference
 
Hi Joe,

Not always. If rangeName refers to a range NAME, it can be on another
worksheet.
If it is only a string variable which represent a range address, then we
assume it is in the
the active sheet.
Regards,

Jean-Yves


"Joe" wrote in message
...
If I see the following in a line of code:

Range(rangeName) = Int(iValue)

Can I assume that this refers to a range in the activesheet?

Joe




joe

a reminder, please - Range w/out qualified reference
 
Frank

Thank you

Joe

Dick Kusleika[_3_]

a reminder, please - Range w/out qualified reference
 
Joe

Also note that the default "roll-up" object is different in class modules
(e.g. ThisWorkbook, Sheet1, etc.) If you use an unqualified 'Range' in, for
example, the Worksheet_Change event for Sheet1, then it will roll-up to the
object represented by that class, namely Sheet1. Similarly, if you use
'Sheets("Sheet1")' in the Workbook_Open event (in the ThisWorkbook class
module), you will be referencing Sheet1 in ThisWorkbook, not in the
ActiveWorkbook. In standard modules, the roll-up object for an unqualified
Range is the activesheet and for an unqualified Sheets(x) is the Active
Workbook.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.


"Jean-Yves" wrote in message
...
Hi Joe,

Not always. If rangeName refers to a range NAME, it can be on another
worksheet.
If it is only a string variable which represent a range address, then we
assume it is in the
the active sheet.
Regards,

Jean-Yves


"Joe" wrote in message
...
If I see the following in a line of code:

Range(rangeName) = Int(iValue)

Can I assume that this refers to a range in the activesheet?

Joe







All times are GMT +1. The time now is 10:45 AM.

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