LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Range.Text/Value returning the number 3?

Grant,
As Dave says, these error normally occur because you are not retrieving a
value from the location you think.
What do you get for
Range("B4").Parent.name
Range("B4").Parent.Parent.name

What does this give ?
Range("B4").Value="Test Value"
Msgbox Range("B4").Value

NickHK

"Grant" wrote in message
...
Hi Dave,

I'm absolutely sure that it's picking up the correct worksheet, etc.

I already specify the worksheet name followed by the range.

It will pickup the correct values just around the cell B4 correctly, but
returns 3 for that cell - and it also does the same thing for some other
cells. I only have one workbook open at the time, and don't specify the
workbook name anywhere.

So if I tried to get the value in B3 it gives me the correct value, etc.

I know it seems strange, but it happens for only some cells, and in
different worksheets (not just one of them).

Any help on this would be great - I'm not sure if there is some sort of

bug
retrieving values from VB.Net using the Interop?

Thanks,

Grant.

"Dave Peterson" wrote:

Are you sure you're picking up B4 from the correct worksheet?

I'd qualify the range to see if that helped.

workbooks("someworkbook").worksheets("somesheet"). range("b4").value



Grant wrote:

Hi,

I am using VB.Net (Interop) and when I try to retrieve a value from a

cell
it returns the number 3 instead of the actual value that is in the

cell.

It happens for some of my cells, but others seem to work fine - I have

no
idea what is happening.

I use Range("B4").Value or Range("B4").Text and also tried
Range("B4").FormulaR1C1, but still get that strange number 3 turning

up.

Any ideas?

Thanks in advance,

Grant.


--

Dave Peterson





 
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
number range returning a text value jason New Users to Excel 3 June 15th 06 08:09 PM
Returning the row number of a cell in a range that matches a given condition Hennie[_3_] Excel Programming 1 February 1st 06 02:07 PM
Returning the row number of a cell in a range that matches a given condition Hennie[_3_] Excel Programming 3 February 1st 06 10:43 AM
Returning a value for a number in a range Derek Excel Discussion (Misc queries) 1 July 26th 05 04:47 PM
Returning true if a number fits between a range David Excel Programming 4 December 10th 04 03:22 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"