View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Another Command button doubt...

the simplest way
if it is always the same cells you want changed,
record a macro changing them
it will be something like

Sub colcel()
Range("D6,F12,H7").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub

assign a button to that macro
change color index to get the color you want

if you want to select the cells then change them
try

Sub colcel1()
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub

if you need the macro to select the cells, what is your criteria?
"xavi garriga" wrote:

Hi to all!

Here you have another question about a macro...

I need to change the fill color of some cells by clicking a command button.
I've searched VB help but I haven0t found anything.

If anyone knows the correct code please write it...

Thanks to all!
--
atrep