LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Retrieving a value from a cell

I am writing a program with VB .NET that uses the Excel
object library. I tried to get a value from a cell and
assign it to a variable:

strVar = CStr(Worksheet.Range("A10").Value)

But if the cell is empty, the returned value is Nothing.
So I modified the code to check for Nothing:

With Worksheet
strVar = CStr(IIf(.Range("A10").Value =
Nothing, "", .Range("A10").Value))
End With

However, I kept getting an Error 91.

I tried checking the .Text property of the cell, but that
always comes back with an empty string if the cell is
hidden.

Any suggestion on how I accomplish this?

 
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
Retrieving hyperlink from cell dezy Excel Worksheet Functions 0 January 3rd 08 03:52 PM
Retrieving a tuple for a cell. SRK Excel Discussion (Misc queries) 0 November 6th 06 09:51 AM
Cell searching and retrieving fluci Excel Discussion (Misc queries) 5 August 4th 05 03:37 PM
Help Retrieving Cell Values Marshall Excel Programming 1 October 28th 03 05:32 PM
Retrieving a cell value with a SQL statement Douglas José Soares Rodrigues Excel Programming 0 August 12th 03 03:21 PM


All times are GMT +1. The time now is 06:27 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"