I need to know how to program a button on an Excel spreadsheet to colour a single cell in a column when clicked and then on the next click the next cell is coloured and so on. I have written a macro that does half the job(see below)but I can't figure out how to go to the next cell on the next click. It works if I manually change the cell reference but can this be done automatically.
Private Sub CommandButton1_Click()
Range("G6"
.Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub
Hope someone can help
Protector
Private Sub CommandButton1_Click()
Range("G6"
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub
Hope someone can help
Protector