ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   range.value changes (https://www.excelbanter.com/excel-discussion-misc-queries/212406-range-value-changes.html)

tina

range.value changes
 
I have a range("e7").value in a function and it gets 1108, but then when it
goes to another function to get the same range - its does not, it got 35449
instead. Why is that? This used to work until I changed it from 1008 to
1108. This is set to text with the '1108 as such in the file.
--
Tina

Chip Pearson

range.value changes
 
It would be helpful is you post the code that is causing the problem.
The value 35449 looks suspiciously like a serial date.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 3 Dec 2008 12:25:50 -0800, Tina
wrote:

I have a range("e7").value in a function and it gets 1108, but then when it
goes to another function to get the same range - its does not, it got 35449
instead. Why is that? This used to work until I changed it from 1008 to
1108. This is set to text with the '1108 as such in the file.


Mike H

range.value changes
 
Tina,

This isn't clear. You refer to Range("E7") being used in a function.
Functions must be in a general module so if the range is qualified

sheets("Sheet1").Range("E7")

it will return the E7 value from the activesheet. Can you post your code.

Mike

"Tina" wrote:

I have a range("e7").value in a function and it gets 1108, but then when it
goes to another function to get the same range - its does not, it got 35449
instead. Why is that? This used to work until I changed it from 1008 to
1108. This is set to text with the '1108 as such in the file.
--
Tina


Jim Thomlinson

range.value changes
 
I think you have a typo...

sheets("Sheet1").Range("E7")

it will return the E7 value from the activesheet.


That line will return the value from Sheet1 and not the active sheet. As a
guess you are on the correct track though. My guess is that Range("E7") is an
unqualified range in tina's code so it pulls from the active sheet when what
Tina probably wants is for the value to come frm a specific sheet...
--
HTH...

Jim Thomlinson


"Mike H" wrote:

Tina,

This isn't clear. You refer to Range("E7") being used in a function.
Functions must be in a general module so if the range is qualified

sheets("Sheet1").Range("E7")

it will return the E7 value from the activesheet. Can you post your code.

Mike

"Tina" wrote:

I have a range("e7").value in a function and it gets 1108, but then when it
goes to another function to get the same range - its does not, it got 35449
instead. Why is that? This used to work until I changed it from 1008 to
1108. This is set to text with the '1108 as such in the file.
--
Tina


Mike H

range.value changes
 
That's what I meant but clearly didn't express it properly, my guess remains
that the OP is using unqualified range references in a function and picking
up unexpected values:)

"Jim Thomlinson" wrote:

I think you have a typo...

sheets("Sheet1").Range("E7")

it will return the E7 value from the activesheet.


That line will return the value from Sheet1 and not the active sheet. As a
guess you are on the correct track though. My guess is that Range("E7") is an
unqualified range in tina's code so it pulls from the active sheet when what
Tina probably wants is for the value to come frm a specific sheet...
--
HTH...

Jim Thomlinson


"Mike H" wrote:

Tina,

This isn't clear. You refer to Range("E7") being used in a function.
Functions must be in a general module so if the range is qualified

sheets("Sheet1").Range("E7")

it will return the E7 value from the activesheet. Can you post your code.

Mike

"Tina" wrote:

I have a range("e7").value in a function and it gets 1108, but then when it
goes to another function to get the same range - its does not, it got 35449
instead. Why is that? This used to work until I changed it from 1008 to
1108. This is set to text with the '1108 as such in the file.
--
Tina



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

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