+ Reply to Thread
Results 1 to 4 of 4

Code to detect if there are any cells which are not blank in a selected Range

  1. #1
    Registered User
    Join Date
    12-26-2016
    Location
    London, England
    MS-Off Ver
    365
    Posts
    79

    Code to detect if there are any cells which are not blank in a selected Range

    Hi I think I only need to replace a line of code in the following to detect if any of the Cells in a selected Range are not blank. i have code to detect Merged Cells but not for single cells.

    Hope someone can help
    Many thanks
    Hans
    I'm still learning !

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Code to detect if there are any cells which are not blank in a selected Range

    Try this in your original code. CountA is a worksheet function that counts cells that are not blank.

    Please Login or Register  to view this content.

    Or here's the whole procedure cleaned up a bit.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 04-07-2018 at 06:11 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Code to detect if there are any cells which are not blank in a selected Range

    Try

    Please Login or Register  to view this content.
    Kind regards
    Leo

  4. #4
    Registered User
    Join Date
    12-26-2016
    Location
    London, England
    MS-Off Ver
    365
    Posts
    79

    Re: Code to detect if there are any cells which are not blank in a selected Range

    Many thanks - That's just what I needed !

    I'm still learning and every response I get from this forum has been just right !!!

    Marked as solved !

    Hans

+ 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] VB Code to detect negative value in range
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2015, 11:57 PM
  2. VBA code to loop through a range of selected cells, to add to my macro
    By craig schultz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2014, 10:30 AM
  3. looking for a vb code for blank cells in a range.
    By pelums1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2013, 01:33 PM
  4. How to display selected range of cells in Textbox1 using VBA code
    By sreekanth446 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2012, 11:40 PM
  5. Gettin Excel to detect blank cells.
    By chasemel in forum Excel General
    Replies: 1
    Last Post: 10-02-2007, 03:37 PM
  6. How to detect row number of selected cells?
    By Ivan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2006, 12:50 AM
  7. [SOLVED] How to detect when a named cell (range) is Blank in VBA?
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2006, 01:30 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