Hi All,
I am learning dynamic range and I have very limited knowledge on VBA. I have cell A11 (value input by users), D10 (Counts the number of rows that A11 returns), B11 (Has an array formula to be copied based on the of D10). Here are my codes ( with the big help of Joe in 2019)
Private Sub Worksheet_Change (ByVal Target As Range)
If Not Intersect(Target, Range ("A11") ) Is Nothing Then
Application.EnableEvents = False
If [D10] > 0 Then
Range ("B12:B" & 11 + [D10] ) .ClearContents 'How do I change this code to clear the contents of non blanks instead?
Range ("B11:B" & 11+ [D10]) .FillDown 'This code copies an extra row of the B11
End If
End Sub
Thank you for your assistance
I am learning dynamic range and I have very limited knowledge on VBA. I have cell A11 (value input by users), D10 (Counts the number of rows that A11 returns), B11 (Has an array formula to be copied based on the of D10). Here are my codes ( with the big help of Joe in 2019)
Private Sub Worksheet_Change (ByVal Target As Range)
If Not Intersect(Target, Range ("A11") ) Is Nothing Then
Application.EnableEvents = False
If [D10] > 0 Then
Range ("B12:B" & 11 + [D10] ) .ClearContents 'How do I change this code to clear the contents of non blanks instead?
Range ("B11:B" & 11+ [D10]) .FillDown 'This code copies an extra row of the B11
End If
End Sub
Thank you for your assistance