Thread: Command Button
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Command Button

One way:

Assuming your command buttons are from the Forms Toolbar, attach these
macros to them (right-click them and choose Attach macro):


Public Sub CommandButton1_Click()
Selection.Interior.ColorIndex = 6 'yellow
End Sub

Public Sub CommandButton2_Click()
Selection.Interior.ColorIndex = 3 'red
End Sub


In article ,
"Hardy" wrote:

I know this probably sounds very simple to most people, but i am new at this!
I would like to create 2 command buttons in a worksheet both doing the same
thing. I would like when each button is clicked the highlighted cells to be
filled in a particular colour. Eg button 1 fills the highlighted cells in
yellow and the second button would fill the highlighted cells in red. Can
anyone help?