Reference cell A1 to change interior color and bold text

seattlerose

New Member
Joined
Mar 8, 2012
Messages
23
Hi all. So i'm working on automation a whole process and i'm stuck on a what I would think was a simple part but it's giving me trouble. I need to loop through a range in column A and if the cell has the same text as cell A1 then bold the text and set interior color to 15. When I run this it does nothing.... I tired putting in "A1" but that doesn't do anything either...

Sub test3()


LRow = Range("A" & Rows.Count).End(xlUp).row


Set MR = Range("A1:A" & LRow)
For Each cell In MR
If cell.Value = "[R1C1]" Then cell.Interior.ColorIndex = 15
If cell.Value = "[R1C1]" Then cell.Font.Bold = True


End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I got it thanks I ended up added another part of the automation and then using that for the fix

Sub Testmacro3()


LRow = Range("A" & Rows.Count).End(xlUp).row


Range("A2:A" & LRow).SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R1C1"


LRow = Range("A" & Rows.Count).End(xlUp).row


Range("A2:A" & LRow).SpecialCells(xlCellTypeFormulas, 23).Select
Selection.Font.Bold = True
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With


End Sub
 
Upvote 0

Forum statistics

Threads
1,215,593
Messages
6,125,716
Members
449,254
Latest member
Eva146

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