AJZLindsay93
New Member
- Joined
- Mar 12, 2019
- Messages
- 3
Hello All,
I am attempting to insert N number of rows based on N being inserted in cell "D7"
Rows are to be inserted at A10, with the formatting (borders) extending to D10
This is the code i have so far but I keep getting the error message "Runtime error 1004 unable to set the weight property of the border class"
Private Sub Worksheet_Change(ByVal Target As Range)
Dim N As Long
If Not Intersect(Target, Me.Range("D7")) Is Nothing Then
With Me
N = .Range("D7").Value2
With .Range("A10:D10").Resize(N)
.Borders.Weight = X1Medium
.Borders.LineStyle = xlContinous
End With
End With
End If
End Sub
Any help would be greatly appreciated
I am attempting to insert N number of rows based on N being inserted in cell "D7"
Rows are to be inserted at A10, with the formatting (borders) extending to D10
This is the code i have so far but I keep getting the error message "Runtime error 1004 unable to set the weight property of the border class"
Private Sub Worksheet_Change(ByVal Target As Range)
Dim N As Long
If Not Intersect(Target, Me.Range("D7")) Is Nothing Then
With Me
N = .Range("D7").Value2
With .Range("A10:D10").Resize(N)
.Borders.Weight = X1Medium
.Borders.LineStyle = xlContinous
End With
End With
End If
End Sub
Any help would be greatly appreciated