Hi I am trying to write a code that will autofill the formula in cell B7 down to the last row in column A. This macro is run on multiple worksheets where the number of rows will change. The problem I am having is when a worksheet only has one row of data and therefore does not need the autofill feature. Is there a way I can tell the macro to autofill the formula if there is data below row 7 and if not to just enter the formula?
So far I have:
Range("B7").Select
ActiveCell.FormulaR1C1 = "=TRIM(MID(R4C3,5,8))"
Selection.AutoFill Destination:=Range("B7:B" & LRow)
So far I have:
Range("B7").Select
ActiveCell.FormulaR1C1 = "=TRIM(MID(R4C3,5,8))"
Selection.AutoFill Destination:=Range("B7:B" & LRow)