gos-c
I did a few experiments. see the file "change color gos.xls"
I placed a command button from the CONTROL TOOLBAR in the cell D1
i right clicked the button and clicked properties
name: cmdfillcolor
caption: fillcolor
if your right click the sheet tab and click view code you can see this event code
remove design mode![]()
Dim r As Range Private Sub cmdfillcolor_Click() Set r = Selection With cmdfillcolor If .Caption = "fill color" Then r.EntireRow.Interior.ColorIndex = 6 .Caption = "" Else .Caption = "fill color" r.EntireRow.Interior.ColorIndex = xlNone End If End With End Sub
now select any one cell in each of two or three different rows(as you know if these are adjacent rows you can use "shift" key otherwise control key
now click the button the rows will be colored with yellow
again click the color will be removed.
do this experiment(using command button as toggle button) two or three times.
now you can modify this button code and also for different buttons you requrie
does it work to your needs.
Bookmarks