Ok here is where i am at:
It seems that it does everything i need except when i put a value
in Column B, the formating occurs only on that row and not from
row 5 down to that line. So all the rows in between are 'no borders'
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LRow As Long
If Target.Column = 2 Then
With Columns("D:BE")
.Borders(xlInsideVertical).LineStyle = xlNone
End With
'old
' LRow = Cells(Rows.Count, 5).End(xlUp).Row
'new
' LRow = Cells(Rows.Count, "B").End(xlUp).Row
'new
LRow = Cells(5, "B").End(xlDown).Row
With Range("D" & LRow, "BE" & LRow)
With .Borders(xlInsideVertical)
.LineStyle = xlDash
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
End If
End Sub
Originally Posted by
mudraker
Your code starts at the bottom row in column 5 (E) and goes up. But you do not use the variable result within your code.
Try changing your code the following 2 commands
LRow = Cells(Rows.Count, "b").End(xlUp).Row
or
LRow = Cells(5, "b").End(xlDown).Row
And
With Range("D" & LRow, "BE" & Lrow)
Bookmarks