We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

handling empty cells when the variable is oher type than string

Thread ID:





50839 Oct 20,2006 12:40 AM Oct 23,2006 03:13 AM Windows Forms 1
Tags: XlsIO
Kari Paukku
Asked On October 20, 2006 12:40 AM


Is there a better way to program a case when,reading data from an excel-sheet, a cell is empty and the data from the cell should go to a double variable?

This works:
Dim d as double
If sheet.Range(Row, 1).Value <> "" Then
d = sheet.Range(Row, 1).Value
End If

However it would be nicer not to have the if clause.


Melba Winshia [Syncfusion]
Replied On October 23, 2006 03:13 AM

Hi Kari,

Use the following code snippets to check if the cell is blank or not.

sheet.Range(2, 1).IsBlank = False

Here is the sample for your reference:


Please take a look at the sample above and let me know if you have any other questions.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.