L
leonidas
Hi,
I have the following code:
Code
-------------------
iLastRow3 = Cells(Rows.Count, "B").End(xlUp).Row
iLastColumn3 = Cells(iLastRow2, Columns.Count).End(xlToLeft).Column
iLastCell = Cells(iLastRow3, iLastColumn3).Address
Range("B7:iLastCell").Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End Wit
-------------------
Problem is I get an error for the line "range("B7:iLastCell").select".
What should I change in the code to fix this problem? Thanks i
advance
I have the following code:
Code
-------------------
iLastRow3 = Cells(Rows.Count, "B").End(xlUp).Row
iLastColumn3 = Cells(iLastRow2, Columns.Count).End(xlToLeft).Column
iLastCell = Cells(iLastRow3, iLastColumn3).Address
Range("B7:iLastCell").Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End Wit
-------------------
Problem is I get an error for the line "range("B7:iLastCell").select".
What should I change in the code to fix this problem? Thanks i
advance