+ Reply to Thread
Results 1 to 32 of 32

Count total blank Cells & Highlight Cell it

  1. #1
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Count total blank Cells & Highlight Cell it

    Greetings,

    Hope you having a great time.

    I want to a "Macro click button" to Count total number of blank Cells & Highlight Cell 'L4' only when full range 'B4:K4' is blank along with Person name. Is it possible

    Please find the Excel Attachment file

    Hight light & Count Blank.xlsx

    any help will be highly appreciated.

    Best,

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Count total blank Cells & Highlight Cell it

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    Hi pipsmultan

    This code works for as many rows as you have names in Column A
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    @ PFDave

    I suggest changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and declaring x
    Please Login or Register  to view this content.
    and making provision for name in Column l

  5. #5
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Count total blank Cells & Highlight Cell it

    Good catch Sintek. Thanks

  6. #6
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Hi,

    Highly appreciated for quick Solution. code works good but their some misunderstanding i think,

    When their is a value in 'B:K' range don't highlight but only count total blank cells. and When their NO value in 'B:K' range then highlight and count as well. Also highlight name of Column A.

    Please find the attachment.
    count-total-blank-cells-and-highlight-cell01.xlsm

    Best,

  7. #7
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Count total blank Cells & Highlight Cell it

    You have highlighted the second name but the is a value in one of the rows, in your notes you state that this shouldn't be highlighted. Which way round is it please?

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    hi pipsmultan

    Let me see if i understand this
    If the empty cell count between B & K = 10 Then l must = 10 and be highlighted and the name in A must be highlighted
    If there is values in cells then put the value of empty cells in L and don't highlight.

  9. #9
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by PFDave View Post
    You have highlighted the second name but the is a value in one of the rows, in your notes you state that this shouldn't be highlighted. Which way round is it please?
    Yes, If their is a value in one of the rows in Column range ('B:K') this shouldn't be highlighted. Only be highlighted if their is No values.

    Best,

  10. #10
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by sintek View Post
    hi pipsmultan

    Let me see if i understand this
    If the empty cell count between B & K = 10 Then l must = 10 and be highlighted and the name in A must be highlighted
    If there is values in cells then put the value of empty cells in L and don't highlight.

    Yes, you understand very well what i am trying to achieve BUT (If there is values in cells then put the value of empty cells in L and don't highlight) and don't highlight name in A as well.

    Best,

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    If so then this code will do the trick...What about your initial request of putting the name in Col L
    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Count total blank Cells & Highlight Cell it

    Please Login or Register  to view this content.
    or if you want the name to appear in L then:

    Please Login or Register  to view this content.

  13. #13
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Count total blank Cells & Highlight Cell it

    Sorry Sintek, stepping on your toes, I'm out now

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by PFDave View Post
    Sorry Sintek, stepping on your toes, I'm out now
    No not at all....this is how we learn from each other

  15. #15
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by sintek View Post
    If so then this code will do the trick...What about your initial request of putting the name in Col L
    Work Great but when i refresh the screen by pressing the Command button it doesn't refresh the screen/values, i have to clear the highlighted cell manually. Is their any way that when i every press the command button it refresh.

    Please find the excel file
    count-total-blank-cells-and-highlight-cell02.xlsm

    Best,

  16. #16
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Count total blank Cells & Highlight Cell it

    seeing as Sintek is otherwise engaged try:

    Please Login or Register  to view this content.

  17. #17
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by pipsmultan View Post
    Work Great but when i refresh the screen by pressing the Command button it doesn't refresh the screen/values, i have to clear the highlighted cell manually. Is their any way that when i every press the command button it refresh.

    Please find the excel file
    Attachment 514852


    Best,
    What do you mean by REFRESH THE SCREEN?Are you looking for code to go into CommandButton to clear the information that our macro has just populated?


    EDIT: If so then this code will help....Assign it to your command Button
    Please Login or Register  to view this content.
    Last edited by sintek; 04-26-2017 at 10:34 AM.

  18. #18
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by PFDave View Post
    seeing as Sintek is otherwise engaged try
    Hi,

    Sorry for late response, Code work exactly as i required, Thanks you & 'sintek' as well you make my problem solve

    1. I Just want to know if i want to count less numbers of Column/Cells, i.e If i want to count only Column (B:F & H & J:K) dont want to count (G & I) how can i do that.

    2. If i insert new Column and want to count that new insert Column how can i do that also.

    Best,

  19. #19
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    In answer to Question2...New column insert
    Change all the L's to M's and all the K's to L's in your code
    i.e. This
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Will come back to you on Question 1

  20. #20
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by sintek View Post
    In answer to Question2...New column insert
    Change all the L's to M's and all the K's to L's in your code

    Will come back to you on Question 1

    Superb many thanks

  21. #21
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by sintek View Post
    Will come back to you on Question 1
    Hi,

    any luck so far regarding the solution for Question 1.

    Thanks

    Best,

  22. #22
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    Took me a while but this is the best i could do....
    Please Login or Register  to view this content.

  23. #23
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by sintek View Post
    Took me a while but this is the best i could do....
    Hi,

    Thanks for the solution. i tried it but it not giving the required results.
    i have uploaded the excel file, i might be doing something wrong. please guide

    count-total-blank-cells-and-highlight-cell04.xlsm

    Best,

  24. #24
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Hi,

    I Just want to to count =B:F,H,J:K and their Total sum of blank Cells count (in between =B:F,H,J:K) in Column 'L',

    Best,

  25. #25
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    This one got me stumped hey...I learned something new today.....Finally a solution...
    Please Login or Register  to view this content.

  26. #26
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Count total blank Cells & Highlight Cell it

    pipsmultan

    Used Conditional formatting.
    Please Login or Register  to view this content.

  27. #27
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by sintek View Post
    This one got me stumped hey...I learned something new today.....Finally a solution..
    Bingo, Superbly solved Worked exactly i am trying from long time.

    just one quick question As i mention in Post '#19' if in future in need to insert New Column how i can add it in the your formula like i.e if i insert two column 'L & M' and i need to to count =B:F, H, J:M and their Total sum of blank Cells count in column 'N' do i have add it like this

    rng1 = WorksheetFunction.CountBlank(.Range(Cells(i, 2), Cells(i, 6)))
    rng2 = WorksheetFunction.CountBlank(.Cells(i, 8))
    rng3 = WorksheetFunction.CountBlank(.Range(Cells(i, 10), Cells(i, 11), Cells(i, 12), Cells(i, 13)))

    Please guide, so that my future problem is also solved. As my current Big problem is all sloved

    Best,

  28. #28
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by jindon View Post
    pipsmultan

    Used Conditional formatting.
    @jindon,

    Thank you sooooooo much for your kind solution and response highly appreciated.

    Your solution works great also i hope i will use it in future.

    Best

  29. #29
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Count total blank Cells & Highlight Cell it

    Quote Originally Posted by pipsmultan View Post
    2. If i insert new Column and want to count that new insert Column how can i do that also.
    Just run once and insert col.L:M.
    This is how combination of conditional formatting and formula acts.
    Please Login or Register  to view this content.

  30. #30
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    Please guide, so that my future problem is also solved.
    Please Login or Register  to view this content.

  31. #31
    Forum Contributor
    Join Date
    06-09-2014
    Location
    Sweden
    Posts
    311

    Re: Count total blank Cells & Highlight Cell it

    perfect, I haven't tried it, But i am sure it will Work like charm

    Thank you 'sintek', PFDave & jindon' without your kind help i cant figure it out.

    Best to all,

    Thread is marked as SOLVED & Reputation Added.

  32. #32
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,173

    Re: Count total blank Cells & Highlight Cell it

    Pleasure...I too learned...Thanks for rep points.

+ 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. Count Cell if two cells are filled and blank
    By adlx72 in forum Excel General
    Replies: 5
    Last Post: 02-13-2017, 04:28 AM
  2. Count blank cells in a range and contiguous blank cells also as single cells! Tricky One!
    By SebastianColombia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2015, 02:32 PM
  3. [SOLVED] Count cells in row based on cell value, highlight row if wrong number or cells.
    By gutterball in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-11-2014, 04:00 PM
  4. Replies: 2
    Last Post: 11-22-2013, 01:07 PM
  5. How to count cells until first non-blank cell
    By FoxIII in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-31-2012, 06:56 AM
  6. total count of non-blank cell(s) and unique values
    By esanchezz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-09-2010, 01:53 PM
  7. Count Blank cells if other cell has certain value!
    By PUKEY in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2009, 06:21 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