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.
Syncfusion Feedback

handling empty cells when the variable is oher type than string

Thread ID:

Created:

Updated:

Platform:

Replies:

50839 Oct 20,2006 04:40 AM UTC Oct 23,2006 07:13 AM UTC Windows Forms 1
loading
Tags: XlsIO
Kari Paukku
Asked On October 20, 2006 04:40 AM UTC

Hi,

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.

TIA,
Kari

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

Hi Kari,

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

[VB]
sheet.Range(2, 1).IsBlank = False

Here is the sample for your reference:

Blank.zip


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

Thanks,
Melba



CONFIRMATION

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.

Warning Icon 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.Close Icon

;