Abhishekghorpade
Board Regular
- Joined
- Oct 3, 2018
- Messages
- 78
Hi
I am using the below code to autofill the formula however there are blank cells in column C I want the same cells in column in S to be blank... Below code is inserting the formula in all the cells..
Sub insert()
Dim LastRow As Integer
Range("S:S").EntireColumn.insert
Range("S1").Value = "LTD Comp"
LastRow = WorksheetFunction.CountA(Worksheets("2018Help").Range("C:C"))
With Worksheets("2018Help").Range("S2")
.formula = "=MIN(R2,275000)"
.AutoFill Destination:=Worksheets("2018Help").Range("S2:S" & LastRow)
End With
End Sub
I am using the below code to autofill the formula however there are blank cells in column C I want the same cells in column in S to be blank... Below code is inserting the formula in all the cells..
Sub insert()
Dim LastRow As Integer
Range("S:S").EntireColumn.insert
Range("S1").Value = "LTD Comp"
LastRow = WorksheetFunction.CountA(Worksheets("2018Help").Range("C:C"))
With Worksheets("2018Help").Range("S2")
.formula = "=MIN(R2,275000)"
.AutoFill Destination:=Worksheets("2018Help").Range("S2:S" & LastRow)
End With
End Sub