+ Reply to Thread
Results 1 to 2 of 2

Check cells for contents

Hybrid View

  1. #1
    Registered User
    Join Date
    06-25-2007
    Posts
    35

    Check cells for contents

    Hi

    I am trying to create code that checks 4 cells for content and if any of the cells don't have content a message tells of this fact.

    Eg. Cells A4, A6, A10 and A11 must contain either text or time (manually input) if either one of the cells has not been populated a message is shown!

    I need this to highlight every row on worksheet so if cell B4 is poppulated so B6, B10 and B11 must be completed also etc.

    Thanks

    Cheelie
    Last edited by cheelie; 09-12-2007 at 06:01 PM.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The highlighting can be done by Conditional Formatting with the custom formula =(A$4=0).

    This code will check if the cells in columns 4,6,10 and 11 on the same row as my cell are all empty (or zero)
    With myCell.EntireRow.
        If 0 = .Range("a4") * .Range("a6") * .Range("a10") * .Range("a11") Then
            MsgBox "Something is empty."
        End If
    End With
    Both these formulations do not distinguish between a blank and an 0. There are other clumbsyer expressions that will do that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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