VBA to fill formula down until last row in empty column

偶尔善良 提交于 2019-12-02 19:25:46

问题


I have a report with a row count that changes daily. I need to autofill column C with a formula down to the last row of column B (columns A and B have different row counts, if that matters).

I have the formula in C2 (and a header in C1), how do I get vba to copy the formula in C2 down to the same row number as column B?


回答1:


let C2 Autofill the column C until the last populated cell in column B:

With Sheets("Report")
  .Range("C2").AutoFill .Range("C2:C" & .Cells(.Rows.count, "B").End(xlUp).row)
End With


来源:https://stackoverflow.com/questions/44191297/vba-to-fill-formula-down-until-last-row-in-empty-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!