Consulting

Results 1 to 6 of 6

Thread: Rectification of VBA script

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Rectification of VBA script

    Hi,
    I am using a script to basically highlight cells if the calculated value is not equal to the below value, and if the cell below it is blank then do nothing.
    Strangely it is working with some value and not working in other value. Can somebody please rectify the code. I don't understand what is wrong in it.
    Thanks in advance.
    PS-I am attaching a dummy sheet for reference.

    [VBA]Sub TurnCellsYellow()
    Dim c As Range
    Selection.Interior.ColorIndex = xlNone
    For Each c In Selection
    If Not IsEmpty(c.Offset(1, 0)) Then
    If c.Offset(1, 0) <> c Then c.Interior.ColorIndex = 6
    End If
    Next c
    End Sub[/VBA]
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •