VBA Script to Paste as Values all Cells with that are Red Font

mp1021257

New Member
Joined
Mar 2, 2016
Messages
19
Hi,

I was wondering if it is possible to write a quick script that will find all cells in a given worksheet (not the whole workbook) that have a red font color (RGB code 255, 0, 0), and paste those cells as values.

For context, I have a worksheet with a bunch of links to other worksheets in a workbook. All the links to other worksheets are colored red. I want to be able to delete those other worksheets without impacting my active worksheet. To do that, I would like to paste all the links to other worksheets as values, and then delete those tabs (since they are no longer referenced on the active worksheet). I was thinking that writing a script that finds all the red font cells and pastes them as values would work, but it would also work to have a script that pastes as values only the cells in an active worksheet that link to another worksheet.

Thanks for the help!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try this:
Code:
Sub check_For_cell_Red_Font()
Application.ScreenUpdating = False
Dim c As Range
    For Each c In ActiveSheet.UsedRange
        If c.Font.Color = RGB(255, 0, 0) Then c.Value = c.Value
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,739
Members
449,050
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top