+ Reply to Thread
Results 1 to 7 of 7

Empty Cells in Range

  1. #1
    Registered User
    Join Date
    07-13-2016
    Location
    CZ
    MS-Off Ver
    2010
    Posts
    14

    Empty Cells in Range

    Hi,

    I need your help. I have cells C8:C10 and G8:G10 and I have macro for detect empty cells. If 1 cell is already empty I will receive MsgBox and this cell will be colored. For example: C8 is empty, I will receive 1x message box "No data" and this cell will be red.

    I have problem if more than 1 cell is empty. I need if for example C8 and G9 are empty I will receive only 1 message box (not more) and of course that all empty cells will be colored.

    Thanks a lot for your help.

    Michal

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Empty Cells in Range

    Post your code.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-13-2016
    Location
    CZ
    MS-Off Ver
    2010
    Posts
    14

    Re: Empty Cells in Range

    Dim cell As Range



    For Each cell In Range("C8:C10, G8:G10")
    If IsEmpty(cell) Then




    MsgBox ("No Data!")

    Range(cell).Interior.ColorIndex = 3
    Range("A1").Select
    End If

    Next cell


    ActiveWorkbook.Windows(1).Caption = Range("C8").Value
    ActiveWorkbook.SaveAs Filename:="Access roles " + Range("C8").Value

    Application.Dialogs(xlDialogSendMail).Show arg1:="[email protected]", arg2:="Access Roles " + Range("C8").Value
    Range("C8:C10, G8:G10").Interior.ColorIndex = 2
    Range("A1").Select



    Many Thanks - I am amater about that

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Empty Cells in Range

    Does this do what you want?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-13-2016
    Location
    CZ
    MS-Off Ver
    2010
    Posts
    14

    Re: Empty Cells in Range

    This is excatly what I need. Thanks a lot.

    I have the last question. How can I set if no cells are empty and I need some additional command (for example next MsgBox or something that).

    Thanks a lot

    M.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Empty Cells in Range

    @ Michal - Per Forum rules please use code tags when posting code. See Rule No. 3.

    Another approach:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Empty Cells in Range

    Glad it does what you wanted.

    Quote Originally Posted by gregorym View Post
    I have the last question. How can I set if no cells are empty and I need some additional command (for example next MsgBox or something that)
    See this amendment:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Can't paste a range of cells into only empty cells of another column
    By mstew in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2014, 03:51 PM
  2. [SOLVED] How to look for empty cells in a range using vb?
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-12-2013, 08:43 AM
  3. [SOLVED] Transfer cells range to another sheet if first cell of destination range is empty
    By kopapa in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-04-2013, 04:32 PM
  4. If the range A1:F1 and the cell H1 are not empty, then all range cells must be not em
    By loroverde in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2013, 04:13 AM
  5. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  6. shift range of cells to left if find the range of empty do while
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2012, 09:25 AM
  7. [SOLVED] sum next two non-empty cells in a range
    By Spencer Hutton in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-09-2005, 08:06 PM

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