Button to change borders

D

dixonpeter

What I'm after is the VB code to get a button to change a blank cell to
have it checked, i.e diagonal lines through it.

Can anyone help?
 
S

StinkeyPete

Try this:

Sub Macro1()
With Selection.Interior
.ColorIndex = 0
.Pattern = xlLightDown
.PatternColorIndex = xlAutomatic
End With

End Sub
 
B

Bryan Hessey

Record a macro, select a cell or range of cells, set the border you
wish, end recording.
Select Tools, Macro, and Edit the macro, remove the Range("~~").select
line.

Then select any cell or range and run the macro.

For a button, do the above, then copy / paste the code into the button
 
Top