Excel ISBLANK Function
The Excel ISBLANK function is used to check if a cell is empty
Example: Excel ISBLANK Function
=ISBLANK("B5")
|
Result in cell C5 (TRUE) - returns a TRUE value given that cell B5 is blank.
|
=ISBLANK(B6)
|
Result in cell C6 (FALSE) - returns a FALSE value given that cell B6 contains a value.
|
METHOD 2. Excel ISBLANK function using the Excel built-in function library
EXCEL
=ISBLANK(B5) Note: in this example we are checking if cell B5 is empty. Given cell B5 is empty the function will return a TRUE value. |
Dim ws As Worksheet
ws.Range("C5").Formula = "=ISBLANK(B5)"
ws.Range("C6").Formula = "=ISBLANK(B6)"
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheet Name: Have a worksheet named ISBLANK.
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell references ("C5") and ("C6") in the VBA code to any cell in the worksheet, that doesn't conflict with formula.
Test Range: Select the cells that you want to check by changing the cell references ("B5") and ("B6") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
Dim ws As Worksheet
If IsEmpty(ws.Range("B5")) Then
Else
End If
Else
End If
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheet Name: Have a worksheet named ISBLANK.
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell references ("C5") and ("C6") in the VBA code to any cell in the worksheet, that doesn't conflict with formula.
Test Range: Select the cells that you want to check by changing the cell references ("B5") and ("B6") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
Dim ws As Worksheet
If IsEmpty(ws.Cells(x, 2)) Then
Else
End If
Next
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheet Name: Have a worksheet named ISBLANK.
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell references (Cells(x, 3)) in the VBA code to any cell in the worksheet that doesn't conflict with formula.
Test Range: Select the cells that you want to check by changing the cell references (Cells(x, 2)) in the VBA code to any cell in the worksheet that doesn't conflict with the formula.
Dim ws As Worksheet
ws.Cells(x, 3).Formula = "=ISBLANK(B" & x & ")"
Next
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheet Name: Have a worksheet named ISBLANK.
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell references (Cells(x, 3)) in the VBA code to any cell in the worksheet that doesn't conflict with formula.
Test Range: Select the cells that you want to check by changing the cell references "B" and "x" which represents the row number in the VBA code to any cell in the worksheet that doesn't conflict with the formula.
The Excel ISBLANK function is used to check if a cell is empty. If a cell is empty the function will return TRUE, however, if the cell contains any characters the function will return.
=ISBLANK(value)
value: The cell to be tested if it's blank.
ADDITIONAL NOTES
Note 1: If the cell return double quotation marks (""), which present the cell as an empty cell, the ISBLANK function will capture this as a non-blank cell and therefore will return a FALSE value.