I recorded a macro to format some data, however the range changes on a bi-weekly basis. Hence, I am trying to incorporate the xldown function to select all of the data until the last row. However, I'm not sure how to incorporate this feature into my current VBA, any help would be greatly appreciated as I have had this function appear multiple times. Thank you!
Range("C2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("C3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]=R[-1]C[-2],R[-1]C&"",""&RC[-1],RC[-1])"
Range("C3").Select
Selection.AutoFill Destination:=Range("C3:C161")
Range("C3:C161").Select
Range("D2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R2C1:RC[-3],RC[-3])"
Range("D2").Select
Selection.AutoFill Destination:=Range("D2:D161")
Ran