I'm looking for a method of copying the exact style of each row across. Here's my example:
background color and border style needs to be copied across to this part:
Now I wrote this code here:
but when I run it, my result looks like this:
As you can see, it just carries across the dotted lines but the top, and bottom borders are also dotted. How do I copy the exact same theme across?
I tried changing from LineStyle to Weight but it just boldens them.
background color and border style needs to be copied across to this part:
Now I wrote this code here:
Code:
Sub SetRowUnifiedStyle()
Dim row As Integer
row = 1563
For i = 2 To 15571
If Range("AN" & CStr(i)) <> 0 Then
Range("AN" & CStr(i) & ":CA" & CStr(i)).Interior.Color = Range("B" & CStr(i)).Interior.Color
'Range("AN" & CStr(i) & ":CA" & CStr(i)).Borders.LineStyle = Range("B" & CStr(i)).Borders.LineStyle
Range("AN" & CStr(i) & ":CA" & CStr(i)).Cells.Borders.LineStyle = Range("B" & CStr(i)).Cells.Borders.LineStyle
End If
Next i
End Sub
but when I run it, my result looks like this:
As you can see, it just carries across the dotted lines but the top, and bottom borders are also dotted. How do I copy the exact same theme across?
I tried changing from LineStyle to Weight but it just boldens them.