+ Reply to Thread
Results 1 to 11 of 11

Highlight blank cell in a selected range of a sheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Question Highlight blank cell in a selected range of a sheet

    i AM GLAD TO ANNOUNCE THAT MY FIRST QUES WAS ANS WITH IN TWO DAYS BY EXCEL FORUM

    SO COMING AGAIN WITH HOPES


    CAN SOMEBODY HELP PLZ PROVIDE ME A MACRO OR VBA THAT CAN HIGHLIGHT ALL THE BLANK CELLS IN A SPECIFIED RANGE WITH YELLOW COLOR LETS SAY COLUMN B7 TO H51000

    AFTER HIGHLIGHTING THE BLANK CELL THE CODE GIVES A MSG TOO"PLEASE FILL ALL THE HIGHLIGHTED YELLOW CELLS"

    LETS SAY B7 IS FILLED BUT B8 IS NOT SO IT CAN HIGHLIGHT B8 AND LIKE WISE AHEAD

    AND SHOW A MSG "DATA COMPLETE YOU MAY PROCEED" IF ALL THE CELLS ARE FILLED
    Last edited by ROHAN999; 04-18-2013 at 12:01 PM.

  2. #2
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    Plz help sir....

  3. #3
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    I have used conditional formatting but its doesnot solve my purpose

  4. #4
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    Beacuse at the begining my sheet is blank and when i used conditional formatting after entering something the yellow color goes but the rest of the cells after the last row of my data entry also remains yellow which defeats purpose

  5. #5
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    Sub Highlight_Cell()
    Dim Rng As Range
    
    For Each Rng In Range("A2:H20") 
    If Rng.Value = "" Then
    Rng.Interior.ColorIndex = 6 ‘yellow
    Else
    Rng.Interior.ColorIndex = 0 'blank
    End If
    Next Rng
    MsgBox "Please fill in all mandatory fields highlighted in yellow."
    End
    CURRENTLY I AM USING THIS CODE BUT IT DOES NOT STOP AT THE LAST ROW OF DATA ENTRY

    PLZ HELP

  6. #6
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    Dim ws As Workbook
    Dim rng1 As Range
    Dim rng2 As Range
    bCheck = False
    'works on sheet 1, change as needed
    Set rng1 = ws.Range("B7:I51000").Find("*", ws.[b7], xlValues, xlWhole, xlByRows)
    If rng1 Is Nothing Then
        MsgBox "DATA IS COMPLETE " & " YOU CAN PROCEED", vbCritical
        Exit Sub
    End If
    Set rng2 = ws.Range(ws.[b7], ws.Cells(rng1.Row, "I"))
    On Error Resume Next
    Set rng2 = rng2.SpecialCells(xlBlanks)
    On Error GoTo 0
    If rng2 Is Nothing Then Exit Sub
    bCheck = True
    rng2.Interior.Color = vbYellow
    MsgBox "Please fill in all mandatory fields on " & ws.Name & " highlighted in yellow", vbCritical, "Save Cancelled!"
    Application.Goto rng2.Cells(1)
    End Sub
    THIS IS ANOTHER TRY BUT THAT IS ALSO NOT WORKING FINE

    PLZ HELP SO THAT WITH THE ACTIVE SHEET AND WITHIN A SPECIFIED RANGE ALL THE BLANK CELLS CAN BE HIGHLIGHTED WITH YELLOW COLOR WITH THE MSG THAT FILL ALL YELLOW COLORED CELLS

    BUT THIS SHOULD BE UPTO LAST DATA ENTRY ROW....

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Highlight blank cell in a selected range of a sheet

    According to the forum rules, you are required to wait at least a day before "bumping" your thread and asking for help again

    Thanks
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  8. #8
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    All right sir...i am waiting...

    I apologies

  9. #9
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    Plz help me sir..i will be greatful...

  10. #10
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Highlight blank cell in a selected range of a sheet

    Any body any help in this regard will be appreciated..

+ 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