Results 1 to 3 of 3

If cell is empty and macro is pressed display error message.

Threaded View

  1. #3
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: If cell is empty and macro is pressed display error message.

    You can try this... it should show a message box with the error if EITHER cell is blank. But since we don't have your code, it's tough to be sure...

    Sub Blanks_OR()
    With Worksheets("Sheet1") ' Change to your sheet name here
    If IsEmpty(.Range("D2")) Or IsEmpty(.Range("A12")) Then
    MsgBox "Please fill in the invoice."
    Else
    ' Put your macro code here
    End If
    End With
    End Sub
    Last edited by Moo the Dog; 12-20-2012 at 02:01 PM. Reason: Forgot to add CODE tags.. my bad :)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1