Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Combine two predefined borders

Hi All,

I'm using MS Office 2007; on the Home tab of the ribbon, on the Font panel,
there is a button to add borders around cells. This button has several
predefined options and i use two alot, i mean really, alot. They are "All
Borders" and "Thick Box Border".

I find that very often i first apply the All Borders and then immediately
apply Thick Box Border. This gives me a thick box around a range of cells
with thin line borders.

Is there a way to define my own border that can give me this result with
only one pick?

Thanks,
Sammy
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default Combine two predefined borders

Hi,

You will need to use VBA:

Sub MyBorders()
On Error Resume Next
With Selection
.Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeTop).Weight = xlMedium
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).Weight = xlThin
End With
End Sub

You might put this in the personal macro workbook so its available for all
workbooks. You can assign a shortcut key and your set.
--
Cheers,
Shane Devenshire


"sammy" wrote:

Hi All,

I'm using MS Office 2007; on the Home tab of the ribbon, on the Font panel,
there is a button to add borders around cells. This button has several
predefined options and i use two alot, i mean really, alot. They are "All
Borders" and "Thick Box Border".

I find that very often i first apply the All Borders and then immediately
apply Thick Box Border. This gives me a thick box around a range of cells
with thin line borders.

Is there a way to define my own border that can give me this result with
only one pick?

Thanks,
Sammy

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Combine two predefined borders

Hi Shane,

Thanks for the perfect code but as i'm sure you know, it is only available
in the current book. I think my next answer will be found in your suggestion
to put it in a personal macro workbook but how would i run it if it is save
in another workbook?

It seems that the code is available with Alt+F8 as long as the workbook
containing the code is open. Is that the trick?

Thanks,
Sammy

"ShaneDevenshire" wrote:

Hi,

You will need to use VBA:

Sub MyBorders()
On Error Resume Next
With Selection
.Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeTop).Weight = xlMedium
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).Weight = xlThin
End With
End Sub

You might put this in the personal macro workbook so its available for all
workbooks. You can assign a shortcut key and your set.
--
Cheers,
Shane Devenshire


"sammy" wrote:

Hi All,

I'm using MS Office 2007; on the Home tab of the ribbon, on the Font panel,
there is a button to add borders around cells. This button has several
predefined options and i use two alot, i mean really, alot. They are "All
Borders" and "Thick Box Border".

I find that very often i first apply the All Borders and then immediately
apply Thick Box Border. This gives me a thick box around a range of cells
with thin line borders.

Is there a way to define my own border that can give me this result with
only one pick?

Thanks,
Sammy

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default Combine two predefined borders

Hi,

To create the personal macro workbook, choose Tools, Macro, Record new
Macro, and change the Store Macro In option to Personal Macro Workbook and
click OK.

Stop the macro recorder, move to the Visual Basic Editor and copy the
previous code to the project Personal.xls. Delete the Macro1 that you
started to record. When you close Excel you will be asked if you want to
save the Personal file, respond Yes.

Excel automatically stores this file in the \XLStart folder, and opens it
everytime you start Excel. Excel also hides the sheets for this workbook.
All of this is handled automatically.

Get rid of the old macro from your other workbook. Assign a shortcut key to
the new macro.
--

Cheers,
Shane Devenshire


"sammy" wrote:

Hi Shane,

Thanks for the perfect code but as i'm sure you know, it is only available
in the current book. I think my next answer will be found in your suggestion
to put it in a personal macro workbook but how would i run it if it is save
in another workbook?

It seems that the code is available with Alt+F8 as long as the workbook
containing the code is open. Is that the trick?

Thanks,
Sammy

"ShaneDevenshire" wrote:

Hi,

You will need to use VBA:

Sub MyBorders()
On Error Resume Next
With Selection
.Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeTop).Weight = xlMedium
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).Weight = xlThin
End With
End Sub

You might put this in the personal macro workbook so its available for all
workbooks. You can assign a shortcut key and your set.
--
Cheers,
Shane Devenshire


"sammy" wrote:

Hi All,

I'm using MS Office 2007; on the Home tab of the ribbon, on the Font panel,
there is a button to add borders around cells. This button has several
predefined options and i use two alot, i mean really, alot. They are "All
Borders" and "Thick Box Border".

I find that very often i first apply the All Borders and then immediately
apply Thick Box Border. This gives me a thick box around a range of cells
with thin line borders.

Is there a way to define my own border that can give me this result with
only one pick?

Thanks,
Sammy

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Combine two predefined borders

Hi,

I am using MS Office 2007 so your instructions were just a little off, for
instance, I no longer have a Tools menu. However, they were close enough to
get the job done.

Thanks for your directions, which I used now and stored for future reference.

Sammy

"ShaneDevenshire" wrote:

Hi,

To create the personal macro workbook, choose Tools, Macro, Record new
Macro, and change the Store Macro In option to Personal Macro Workbook and
click OK.

Stop the macro recorder, move to the Visual Basic Editor and copy the
previous code to the project Personal.xls. Delete the Macro1 that you
started to record. When you close Excel you will be asked if you want to
save the Personal file, respond Yes.

Excel automatically stores this file in the \XLStart folder, and opens it
everytime you start Excel. Excel also hides the sheets for this workbook.
All of this is handled automatically.

Get rid of the old macro from your other workbook. Assign a shortcut key to
the new macro.
--

Cheers,
Shane Devenshire


"sammy" wrote:

Hi Shane,

Thanks for the perfect code but as i'm sure you know, it is only available
in the current book. I think my next answer will be found in your suggestion
to put it in a personal macro workbook but how would i run it if it is save
in another workbook?

It seems that the code is available with Alt+F8 as long as the workbook
containing the code is open. Is that the trick?

Thanks,
Sammy

"ShaneDevenshire" wrote:

Hi,

You will need to use VBA:

Sub MyBorders()
On Error Resume Next
With Selection
.Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeTop).Weight = xlMedium
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).Weight = xlThin
End With
End Sub

You might put this in the personal macro workbook so its available for all
workbooks. You can assign a shortcut key and your set.
--
Cheers,
Shane Devenshire


"sammy" wrote:

Hi All,

I'm using MS Office 2007; on the Home tab of the ribbon, on the Font panel,
there is a button to add borders around cells. This button has several
predefined options and i use two alot, i mean really, alot. They are "All
Borders" and "Thick Box Border".

I find that very often i first apply the All Borders and then immediately
apply Thick Box Border. This gives me a thick box around a range of cells
with thin line borders.

Is there a way to define my own border that can give me this result with
only one pick?

Thanks,
Sammy

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
One click date + predefined text input. James.T[_2_] Excel Discussion (Misc queries) 3 August 1st 08 06:19 PM
Is there a way to delete a predefined footer in Excel ? LisaC Excel Discussion (Misc queries) 5 September 10th 07 10:04 PM
Calling a Userform from a Predefined Variable [email protected] Excel Worksheet Functions 0 April 21st 07 03:44 PM
Creating a new worksheet using predefined rows Aaron Excel Worksheet Functions 2 March 28th 07 02:16 AM
sum quarters to years; predefined shift of ranges Goose Excel Discussion (Misc queries) 4 February 23rd 07 03:07 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"