ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   custom borders icon to use on the tool bar (https://www.excelbanter.com/excel-discussion-misc-queries/11401-custom-borders-icon-use-tool-bar.html)

robin

custom borders icon to use on the tool bar
 
I want to make a custome borders icon to use on the tool bar. I need a
double line at the top and a single line at the bottom. PLease help, Robin

Gord Dibben

robin

This is the code I got when I recorded a macro while formatting as you
describe.

Copy/paste to a general module in your workbook. For instructions on creating
a general module see below.

Assign it to a button on your Toolbar.

Sub Macro2()
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub

To get a button to the Toolbar you can.........

ToolsCustomizeCommandsMacros.

Drag the smiley-face to the Toolbar.

Right-click on it a Assign Macro and also "Change Button Image" if you wish.

OK your way out.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Thu, 3 Feb 2005 10:09:02 -0800, "robin"
wrote:

I want to make a custome borders icon to use on the tool bar. I need a
double line at the top and a single line at the bottom. PLease help, Robin



robin

Thank you,
It works, the only thing is, it does not allow me to undo it without
clearing the borders using the clear borders button. Is there an additional
command I can put into the macros to allow the undo feature to work?
Thanks, Robin

"Gord Dibben" wrote:

robin

This is the code I got when I recorded a macro while formatting as you
describe.

Copy/paste to a general module in your workbook. For instructions on creating
a general module see below.

Assign it to a button on your Toolbar.

Sub Macro2()
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub

To get a button to the Toolbar you can.........

ToolsCustomizeCommandsMacros.

Drag the smiley-face to the Toolbar.

Right-click on it a Assign Macro and also "Change Button Image" if you wish.

OK your way out.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Thu, 3 Feb 2005 10:09:02 -0800, "robin"
wrote:

I want to make a custome borders icon to use on the tool bar. I need a
double line at the top and a single line at the bottom. PLease help, Robin




Gord Dibben

robin

For sample "Undo" code see John Walkenbach's site.

http://www.j-walk.com/ss/excel/tips/tip23.htm


Gord

On Thu, 10 Feb 2005 11:15:02 -0800, "robin"
wrote:

Thank you,
It works, the only thing is, it does not allow me to undo it without
clearing the borders using the clear borders button. Is there an additional
command I can put into the macros to allow the undo feature to work?
Thanks, Robin

"Gord Dibben" wrote:

robin

This is the code I got when I recorded a macro while formatting as you
describe.

Copy/paste to a general module in your workbook. For instructions on creating
a general module see below.

Assign it to a button on your Toolbar.

Sub Macro2()
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub

To get a button to the Toolbar you can.........

ToolsCustomizeCommandsMacros.

Drag the smiley-face to the Toolbar.

Right-click on it a Assign Macro and also "Change Button Image" if you wish.

OK your way out.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Thu, 3 Feb 2005 10:09:02 -0800, "robin"
wrote:

I want to make a custome borders icon to use on the tool bar. I need a
double line at the top and a single line at the bottom. PLease help, Robin






All times are GMT +1. The time now is 12:45 AM.

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