M
Michael M
Hi All
The code below works fine, but I would like to simplify it.
As you can tell it is recorded code except for the cell ranges.
Any assistance in shortening the code would be appreciated, if only to
improve my knowledge !!!
With range("E17:G" & lrow + 2)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.Font.Size = 10
.NumberFormat = "#,##0.00"
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
For Each c In range("H17:H" & lrow + 2)
With c.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Next
For Each c In range("C17:C" & lrow + 2)
With Selection
.Borders(xlEdgeLeft).LineStyle = xlNone
End With
Next
Regards
Michael M
The code below works fine, but I would like to simplify it.
As you can tell it is recorded code except for the cell ranges.
Any assistance in shortening the code would be appreciated, if only to
improve my knowledge !!!
With range("E17:G" & lrow + 2)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.Font.Size = 10
.NumberFormat = "#,##0.00"
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
For Each c In range("H17:H" & lrow + 2)
With c.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Next
For Each c In range("C17:C" & lrow + 2)
With Selection
.Borders(xlEdgeLeft).LineStyle = xlNone
End With
Next
Regards
Michael M