MrDJShanahan
New Member
- Joined
- Aug 8, 2019
- Messages
- 6
Hi. I'm a bit of a novice when it comes to VBA. I'm trying to extend the following set of commands down from row 2 to row 200. I know that I need to use an Integer, but I cant work it out
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("J12")) Is Nothing Then
Range("K12, S12").ClearContents
End If
If Not Intersect(Target, Range("T12")) Is Nothing Then
Range("V12, Y12").ClearContents
End If
If Not Intersect(Target, Range("W12")) Is Nothing Then
Range("Y12, AB12").ClearContents
End If
If Not Intersect(Target, Range("AA12")) Is Nothing Then
Range("AB12:AD12").ClearContents
End If
If Not Intersect(Target, Range("AJ12")) Is Nothing Then
Range("AL12, AO12").ClearContents
End If
If Not Intersect(Target, Range("AN12")) Is Nothing Then
Range("AO12:AQ12").ClearContents
End If
If Not Intersect(Target, Range("AW12")) Is Nothing Then
Range("AY12, BB12").ClearContents
End If
If Not Intersect(Target, Range("AN12")) Is Nothing Then
Range("BB12:BD12").ClearContents
End If
If Not Intersect(Target, Range("BJ12")) Is Nothing Then
Range("BL12, BO12").ClearContents
End If
If Not Intersect(Target, Range("BN12")) Is Nothing Then
Range("BO12:BQ12").ClearContents
End If
If Not Intersect(Target, Range("BW12")) Is Nothing Then
Range("BY12, CB12").ClearContents
End If
If Not Intersect(Target, Range("CA12")) Is Nothing Then
Range("CB12:CD12").ClearContents
End If
End Sub
Any hints or suggestions?
Thanks
D
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("J12")) Is Nothing Then
Range("K12, S12").ClearContents
End If
If Not Intersect(Target, Range("T12")) Is Nothing Then
Range("V12, Y12").ClearContents
End If
If Not Intersect(Target, Range("W12")) Is Nothing Then
Range("Y12, AB12").ClearContents
End If
If Not Intersect(Target, Range("AA12")) Is Nothing Then
Range("AB12:AD12").ClearContents
End If
If Not Intersect(Target, Range("AJ12")) Is Nothing Then
Range("AL12, AO12").ClearContents
End If
If Not Intersect(Target, Range("AN12")) Is Nothing Then
Range("AO12:AQ12").ClearContents
End If
If Not Intersect(Target, Range("AW12")) Is Nothing Then
Range("AY12, BB12").ClearContents
End If
If Not Intersect(Target, Range("AN12")) Is Nothing Then
Range("BB12:BD12").ClearContents
End If
If Not Intersect(Target, Range("BJ12")) Is Nothing Then
Range("BL12, BO12").ClearContents
End If
If Not Intersect(Target, Range("BN12")) Is Nothing Then
Range("BO12:BQ12").ClearContents
End If
If Not Intersect(Target, Range("BW12")) Is Nothing Then
Range("BY12, CB12").ClearContents
End If
If Not Intersect(Target, Range("CA12")) Is Nothing Then
Range("CB12:CD12").ClearContents
End If
End Sub
Any hints or suggestions?
Thanks
D