I have a sheet where there is data from A3-A6. But this can be dynamic. The number of rows can change. I have formulas written in D3 all the way till BU3. I would like to extend these - Autofill to D6 automatically. But if the data is till A7, the formula should extend to A7 as well. The code which i have written is below. The problem is without there being data in A7 the formula is still getting copied over there. Also there is the next set of data from A19 which should not be impacted by this formulas. A6-A19 are blanks
Sheets("Working").Select
Set sht = ActiveSheet
Dim LR As Long
LR = sht.Range("A3").CurrentRegion.Rows.Count
Range("D3:BU3").Select
Selection.AutoFill Destination:=Range("D3:BU" & LR), Type:=xlFillDefault