Add value of (1) to a selected cell or cells

C

Coaxis

I'm comfortable with excel and formulas but never used any of th
developer features.

Can anyone tell me how I could:
click a button I have created on the sheet that will change the value o
highlighted cells to the value (1) and fill the cells with a color?

In my head this is how it would work:
1) highlight a group of cells
2) Click the button
All highlighted cells would now contain the value 1 and be fille
yellow.

I can create the button and assign a macro to it. I just have no ide
how to write the macro, or if its even possible.

I'm open to other ideas if I am going about this all wrong
 
G

Gord Dibben

Sub One_And_Color()
Dim rng As Range
Set rng = Selection
With rng
.Value = 1
.Interior.Color = vbYellow
End With
End Sub


Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top