+ 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

    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

  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

    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....

  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

    My data will be with in b7 to i510000

    plz help...

+ 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