+ Reply to Thread
Results 1 to 6 of 6

macro empty cells

Hybrid View

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    macro empty cells

    Hello,
    this part of the macro does not work:


    If Range ("A2: A100) =" "Then
    MsgBox "empty cells", vbCritical + vbOKOnly, "Attention!" 
    Exit Sub
    end If

    If the range A2: A100 is empty warning "empty cells."
    A help?
    max_max
    Last edited by max_max; 03-03-2016 at 02:27 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: macro empty cells

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  3. #3
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: macro empty cells

    O.k. correct
    max_max

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: macro empty cells

    Try

    If Worksheetfunction.Counta(Range("A2:A100)) = 0 Then
    MsgBox "empty cells", vbCritical + vbOKOnly, "Attention!" 
    Exit Sub
    end If

  5. #5
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: macro empty cells

    Hello,
    zbor is o.k thanks.
    A greeting.
    max_max

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: macro empty cells

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Macro to copy paste specific cells into empty cells below them
    By qlo_0lp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2014, 04:49 PM
  2. [SOLVED] How to run macro till empty cells
    By majdi.marmas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2013, 12:58 PM
  3. 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
  4. Macro can see the formulas and thus cells are not empty
    By cyphrevil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-22-2012, 10:29 AM
  5. Macro to hide empty cells
    By sivdin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-05-2009, 02:45 AM
  6. macro to colour empty cells (cells not recognized as empty)
    By Gerben in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2005, 11:05 AM
  7. Macro to copy value in empty cells
    By Esrei in forum Excel General
    Replies: 3
    Last Post: 04-19-2005, 11:06 AM

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