Grid Lines vs. Borders

  • Thread starter Format Challenged
  • Start date
F

Format Challenged

Hello.

Does anyone know if it's possible in Excel XP using VBA to
code a sheet so that the grid lines print very faint
without altering black borders (used for pseudo
underlining)?

If not, is there a way to make an underline appear all the
way across a cell to make it look like a border - even
blank cells?

Your example code would be most helpful in either case.
Thanks in advance for your assistance.
 
G

GJones

The folloing does the firs row. You could do them all by
changing the range for the select but remember if you put
the underline in it will print even if there is no data.
So if you were to do this for all lines then you would
print down to 65656.

Sub try()

Rows("1:1").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
End Sub
 

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.

Ask a Question

Top