ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Button to change borders (https://www.excelbanter.com/excel-discussion-misc-queries/40107-button-change-borders.html)

dixonpeter

Button to change borders
 

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?


--
dixonpeter


------------------------------------------------------------------------
dixonpeter's Profile: http://www.excelforum.com/member.php...fo&userid=2589
View this thread: http://www.excelforum.com/showthread...hreadid=395282


StinkeyPete

Try this:

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

End Sub



"dixonpeter" wrote:


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?


--
dixonpeter


------------------------------------------------------------------------
dixonpeter's Profile: http://www.excelforum.com/member.php...fo&userid=2589
View this thread: http://www.excelforum.com/showthread...hreadid=395282



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
on button creation.




dixonpeter Wrote:
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?



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=395282



All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com