PDA

View Full Version : Highlight The Selected.



adamsm
02-09-2011, 08:01 AM
Hi,

I'm having the following code that colors the cell A1 when the macro is run.

How could I modify the code so that it would color any selected cell.

Any help on this will be kindly appreciated.

Thanks in advance.
Sub Selects()
Range("A1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = vbYellow
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub

Tinbendr
02-09-2011, 08:29 AM
Sub Selects()
With ActiveCell.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = vbYellow
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub

adamsm
02-11-2011, 01:53 PM
Thanks for the help. I do really appreciate it.