Posts by rajeshn_in

    Hi Friends,


    I had posted the same issue yesterday in below web site, I did'nt get solution, thats way I am posting here. Please consider my apology if it is wrong.


    https://www.excelforum.com/exc…f-format.html#post4872602


    Issue :


    I am using below excel with wrap text. in Excel document its showing correctly, but when I am trying for PDF then some line are not coming properly. Please see attachments for better understanding. Some cells using extra space at the bottom. Some cells not coming in to box at the bottom.


    Thank you.

    Finally I got a code as below :


    [vba]


    Sub Remove_Color3()


    Dim i As Integer


    Application.ScreenUpdating = False
    For i = 2 To 255


    If Cells(i, 1) = Cells(i + 1, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 1, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 1, 1).Font.Bold Then
    Cells(i + 1, 1).Interior.ColorIndex = iNone
    Cells(i + 1, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 2, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 2, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 2, 1).Font.Bold Then
    Cells(i + 2, 1).Interior.ColorIndex = iNone
    Cells(i + 2, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 3, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 3, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 3, 1).Font.Bold Then
    Cells(i + 3, 1).Interior.ColorIndex = iNone
    Cells(i + 3, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 4, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 4, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 4, 1).Font.Bold Then
    Cells(i + 4, 1).Interior.ColorIndex = iNone
    Cells(i + 4, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 5, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 5, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 5, 1).Font.Bold Then
    Cells(i + 5, 1).Interior.ColorIndex = iNone
    Cells(i + 5, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 6, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 6, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 6, 1).Font.Bold Then
    Cells(i + 6, 1).Interior.ColorIndex = iNone
    Cells(i + 6, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 7, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 7, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 7, 1).Font.Bold Then
    Cells(i + 7, 1).Interior.ColorIndex = iNone
    Cells(i + 7, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 8, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 8, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 8, 1).Font.Bold Then
    Cells(i + 8, 1).Interior.ColorIndex = iNone
    Cells(i + 8, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 9, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 9, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 9, 1).Font.Bold Then
    Cells(i + 9, 1).Interior.ColorIndex = iNone
    Cells(i + 9, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 10, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 10, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 10, 1).Font.Bold Then
    Cells(i + 10, 1).Interior.ColorIndex = iNone
    Cells(i + 10, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 11, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 11, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 11, 1).Font.Bold Then
    Cells(i + 11, 1).Interior.ColorIndex = iNone
    Cells(i + 11, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 12, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 12, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 12, 1).Font.Bold Then
    Cells(i + 12, 1).Interior.ColorIndex = iNone
    Cells(i + 12, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 13, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 13, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 13, 1).Font.Bold Then
    Cells(i + 13, 1).Interior.ColorIndex = iNone
    Cells(i + 13, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 14, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 14, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 14, 1).Font.Bold Then
    Cells(i + 14, 1).Interior.ColorIndex = iNone
    Cells(i + 14, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 15, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 15, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 15, 1).Font.Bold Then
    Cells(i + 15, 1).Interior.ColorIndex = iNone
    Cells(i + 15, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 16, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 16, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 16, 1).Font.Bold Then
    Cells(i + 16, 1).Interior.ColorIndex = iNone
    Cells(i + 16, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 17, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 17, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 17, 1).Font.Bold Then
    Cells(i + 17, 1).Interior.ColorIndex = iNone
    Cells(i + 17, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 18, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 18, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 18, 1).Font.Bold Then
    Cells(i + 18, 1).Interior.ColorIndex = iNone
    Cells(i + 18, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 19, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 19, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 19, 1).Font.Bold Then
    Cells(i + 19, 1).Interior.ColorIndex = iNone
    Cells(i + 19, 1).Font.Bold = False
    End If


    If Cells(i, 1) = Cells(i + 20, 1) And _
    Cells(i, 1).Interior.ColorIndex = Cells(i + 20, 1).Interior.ColorIndex And _
    Cells(i, 1).Font.Bold = Cells(i + 20, 1).Font.Bold Then
    Cells(i + 20, 1).Interior.ColorIndex = iNone
    Cells(i + 20, 1).Font.Bold = False
    End If




    Next i
    Application.ScreenUpdating = True


    End Sub
    [\vba]





    will anyone please try to reduce the above code please.


    Thank you.

    Hi friends,


    With below code, I can get red color in modified cells. After some time or days I will change red colored cells into no color, but that time previous color also removing. How can I keep my original color. Please check sample workbook.


    [VBA]Option Explicit



    Private Sub Worksheet_Change(ByVal Target As Range)


    Application.ScreenUpdating = False
    Application.EnableEvents = False



    Target.Interior.ColorIndex = 3
    Target.Font.Bold = True


    exitHandler:
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    End Sub
    [/VBA]


    Module:
    [VBA]Sub Color()
    Dim myRange As Range
    Dim cell As Range
    Set myRange = Range("A1:AU1200")
    For Each cell In myRange
    If cell.Interior.ColorIndex = 3 And _
    cell.Font.Bold = True Then
    cell.Interior.ColorIndex = 0
    cell.Font.Bold = False


    End If
    Next
    End Sub


    [/VBA]


    Thank you Friends,

    Thank you very much Trebor76, Its working good.


    One small update please. In original sheet I have 50 + columns, but I want only few columns, how can I past perticular columns with range. Please update this small thing.


    For example, Filter A column and past B, G, H, I, J, K, M, AB, AJ Columns.


    Thank you.

    Hi friends,


    Using below code I am getting one cell information, how can I get multiple cells information.



    Thank you Friends.