Consulting

Results 1 to 4 of 4

Thread: Check Cell for Blank

  1. #1

    Check Cell for Blank

    Hi,

    I just started learning VBA yesterday and don't have much knowledge. How do you write codes to check whether a cell is blank or not? If it does have a blank, it will throw out an error message.

  2. #2
    VBAX Mentor
    Joined
    Aug 2008
    Posts
    323
    Location
    [VBA]If (IsEmpty(Cells(1, 2))) Then
    MsgBox "1"
    Else
    MsgBox "2"
    End If[/VBA]
    I am a Newbie, soon to be a Guru

  3. #3
    Thanks appreciate it.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Or commonly
    [VBA]If Cells(1,1) = "" Then[/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •