Do you mean you want to add a border to a cell (or a range) and then draw a
horizontal line?
Not possible with a single cell
With a range, draw a border around each half
best wishes
Select the cell with "Buyer/Address"
Locate the border tool( in Excel 2003 it is to the right on the Format
toolbar; in Excel 2007 it is in the Font group on the Home tab). Click this
tool's launch arrow. Now select the "Outside Border" item (in Excel 2003 it
is third on the third row, in Excel 2007 it is the seventh item down)
Now your cell has a border around it
Note that the border tool nor shows a single square.
Select the four cells ( Jackson , Somewhere , On Mars, Opp Venus ) and
click the Border tool
This seems to give what you are aiming for
best wishes
Have you though of recording a macro as you carry out the step I gave?
This is wahtr I get; as with most recorded macros, iyt has some unrequirted
code that could be editied out
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 14/01/2009 by Bernard V Liengme
'
Range("F6").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("F7:F9").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub
I did find some C#/VB code in MSDN which helped me overcome the problem.
Incidentally, i used code which is along the same lines as the one provided
by you.
Thanks for your efforts.
Barry
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.