Hi guys,
Please help me if anyone knows a VBA code to do this task easily.
I attached a sample and all I'm trying to do is to change all blue color fonts into black.
Thanks as always.
Brian
Hi guys,
Please help me if anyone knows a VBA code to do this task easily.
I attached a sample and all I'm trying to do is to change all blue color fonts into black.
Thanks as always.
Brian
Don't laugh.
![]()
Sub Test() Columns("C").Font.Color = vbBlack End Sub
Thanks, but I want to apply it to whole workbook, not only column c.
Oh. Try this then.
![]()
Sub Test() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets ws.Cells.Font.Color = vbBlack Next ws End Sub
JieJenn,
Thanks so much - it works perfect!
Just one more question - I realized that some of cells actually have a few different colors and using your formula - they're all changed to black color.
In the VBA code you wrote for me, is it possible to add some sort of if function, such as changing only colors in 160, 184, 214 (blue font color I'm using).
Thanks so much!
change ws.cell to ws.Range([insert range here])
like this right?
Sub Test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Range([160,184,214]).Font.color = vbBlack
Next ws
End Sub
Oh wait. I mis-read your post. Can you upload a sample file?
Try this. the blue color font index in your sample file is 12611584
![]()
Sub Test() Dim ws As Worksheet Dim i As Integer Dim cell As Range For i = 1 To Sheets.Count Worksheets(i).Select For Each cell In Cells.SpecialCells(xlCellTypeConstants) If cell.Font.Color = 12611584 Then cell.Font.Color = vbBlack End If Next cell For Each cell In Cells.SpecialCells(xlCellTypeFormulas) If cell.Font.Color = 12611584 Then cell.Font.Color = vbBlack End If Next cell Next i End Sub
Thank you so much for your help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks