Accessing Isblank In Vba

  • Re: Accessing Isblank In Vba

    vba has it's own methods so the worksheet function is not supported via the object model.

    try either of these
    [vba] If Cells(RowIndex, ColIndex) = "" Then

    If Len(Cells(RowIndex, ColIndex)) = 0 Then

  • Re: Accessing Isblank In Vba

    Quote from Om Avataar

    Is the following valid code in Excel VBA?

    If Application.WorksheetFunction.isblank(Cells(RowIndex, ColIndex)) Then


    Do you use some Loop? The best way for it:

    For each EmptyCell in YourRange.SpecialCells(xlCellTypeBlanks)
    Next EmptyCell


    For each NonEmptyCell in YourRange.SpecialCells(xlCellTypeConstants)
    Next NonEmptyCell

    Or you can Access to IsBlank function by:

    If Evaluate("Isblank(" & Cells(RowIndex, ColIndex).address & ")") Then

    But I suggest you to use SpecialCells method if it's possible.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!