Alex Campbell
asked on
In Excel 2016, how can I make every other line in worksheet a different line thickness?
ASKER
Attached is a sample file with before and after tabs.
I tried Conditional Formatting, but it doesn't have the line width that I wanted.
I don't how to write a macro to format the lines.
Borders.xlsx
I tried Conditional Formatting, but it doesn't have the line width that I wanted.
I don't how to write a macro to format the lines.
Borders.xlsx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great! Thanks
Pleased to help. This may be easierto manage and adds the numbers if required
Option Explicit
Sub addLine()
Dim Rw As Long
Const TotalRows As Long = 500 ''/// change this number to how many rows you want
Application.ScreenUpdating = False
For Rw = 2 To TotalRows Step 2
With Range(Cells(Rw, 2), Cells(Rw, 11)).Borders(xlEdgeBottom)
Cells(Rw, 1).Value = Rw
Cells(Rw - 1, 1).Value = Rw - 1
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThick
End With
Next Rw
Application.ScreenUpdating = True
End Sub
ASKER
Thanks for that, too. I appreciate different versions for learning.
Please provide a sample workbook.
First option would be to copy first tow rows range and paste special formats.
Second option would be to write VBA.