View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
xavi garriga xavi garriga is offline
external usenet poster
 
Posts: 31
Default Another Command button doubt...

Ok Many thanks!

I'll try the solutions ans tell you if they work!

--
atrep


"Dave Peterson" wrote:

Try recording a macro when you change the selected cell's fill color.

Then stop recording.

Then add a commandbutton from the control toolbar toolbox to the worksheet.

Double click on that commandbutton and you'll see where you want to move the
code.

Then delete the original recorded macro.

When you're done, you should end up with a routine that looks like:

Option Explicit
Private Sub CommandButton1_Click()
Selection.Interior.ColorIndex = 35
End Sub

The number will depend on what color you use.

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


--

Dave Peterson