Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for outline border
Excel XP & Win XP
When I record a macro and place an outline border, the recorder of course lays down a bunch of lines encompassing every facet of the border. Is there a simple command to produce an outline border? Thanks for your time. Otto |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for outline border
Otto,
I'm assuming you want to create a single border around a range of cells, not setting the borders for each individual cell in the range. Try Range("C3:D20").BorderAround Weight:=xlMedium You could modify this to Selection.BorderAround Weight:=xlMedium ' or ActiveCell.BorderAround Weight:=xlMedium -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Otto Moehrbach" wrote in message ... Excel XP & Win XP When I record a macro and place an outline border, the recorder of course lays down a bunch of lines encompassing every facet of the border. Is there a simple command to produce an outline border? Thanks for your time. Otto |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for outline border
Otto
To outline each cell in selection............. Sub Border_Cells() With Selection .Borders.LineStyle = xlContinuous .Borders.Weight = xlThick .Borders.ColorIndex = xlAutomatic End With End Sub To outline around cells in selection......... Sub Border_Cells22() With Selection.Borders .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = xlAutomatic End With With Selection .Borders(xlInsideVertical).LineStyle = xlNone .Borders(xlInsideHorizontal).LineStyle = xlNone End With End Sub Gord On Sat, 23 Dec 2006 14:05:51 -0500, "Otto Moehrbach" wrote: Excel XP & Win XP When I record a macro and place an outline border, the recorder of course lays down a bunch of lines encompassing every facet of the border. Is there a simple command to produce an outline border? Thanks for your time. Otto |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for outline border
Chip
You're like a gold mine. Thanks for all your help, before as well as now. Otto "Chip Pearson" wrote in message ... Otto, I'm assuming you want to create a single border around a range of cells, not setting the borders for each individual cell in the range. Try Range("C3:D20").BorderAround Weight:=xlMedium You could modify this to Selection.BorderAround Weight:=xlMedium ' or ActiveCell.BorderAround Weight:=xlMedium -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Otto Moehrbach" wrote in message ... Excel XP & Win XP When I record a macro and place an outline border, the recorder of course lays down a bunch of lines encompassing every facet of the border. Is there a simple command to produce an outline border? Thanks for your time. Otto |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for outline border
Cool!
Thanks Chip.....never new the BorderAround existed. Found it in help under the Range Object section. Do you think I should read the Help section more often? <g Gord On Sat, 23 Dec 2006 13:18:12 -0600, "Chip Pearson" wrote: Otto, I'm assuming you want to create a single border around a range of cells, not setting the borders for each individual cell in the range. Try Range("C3:D20").BorderAround Weight:=xlMedium You could modify this to Selection.BorderAround Weight:=xlMedium ' or ActiveCell.BorderAround Weight:=xlMedium |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for outline border
Do you think I should read the Help section more often? <g
Never hurts to read the Help. Actually, I find most of this sort of stuff by poking around the Object Browser in VBA. And speaking of Help, I've found the Help in Excel 2007 to be MUCH better than the Help in previous versions. I've got it configured to search both online and offline help, and everytime I've used it (mainly to find out where in the hell they moved a command to), I've found what I'm looking for on the first try. It seems that MS finally realized that Help was meant to be used. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Gord Dibben" <gorddibbATshawDOTca wrote in message ... Cool! Thanks Chip.....never new the BorderAround existed. Found it in help under the Range Object section. Do you think I should read the Help section more often? <g Gord On Sat, 23 Dec 2006 13:18:12 -0600, "Chip Pearson" wrote: Otto, I'm assuming you want to create a single border around a range of cells, not setting the borders for each individual cell in the range. Try Range("C3:D20").BorderAround Weight:=xlMedium You could modify this to Selection.BorderAround Weight:=xlMedium ' or ActiveCell.BorderAround Weight:=xlMedium |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code for outline border
Thanks Chip.
Not upgraded yet to 2007. At my age the learning curve is getting steeper so may not bother. Gord On Sat, 23 Dec 2006 15:13:05 -0600, "Chip Pearson" wrote: Do you think I should read the Help section more often? <g Never hurts to read the Help. Actually, I find most of this sort of stuff by poking around the Object Browser in VBA. And speaking of Help, I've found the Help in Excel 2007 to be MUCH better than the Help in previous versions. I've got it configured to search both online and offline help, and everytime I've used it (mainly to find out where in the hell they moved a command to), I've found what I'm looking for on the first try. It seems that MS finally realized that Help was meant to be used. Gord Dibben MS Excel MVP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Shape Outline (border) | Excel Discussion (Misc queries) | |||
Conditional Format - Outline Border | Excel Worksheet Functions | |||
Conditional Formatting - Frame cells with Outline Border | Excel Discussion (Misc queries) | |||
Conditional Format - Outline Border | Excel Worksheet Functions | |||
only last cell on page to have bottom border (cell area outline) | Excel Worksheet Functions |