目前,我使用此代码自动填充最后一列的公式:
Dim lngLastColumn As Long
lngLastColumn = Cells.Find(What:="*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Range(Activecell, Cells(Activecell.Row, lngLastColumn)).FillRight但它一次只适用于一行。是否有一种方法将其应用于我所选择的所有行?
谢谢,
托马斯
发布于 2018-08-14 14:20:29
你可以试试这个:
Dim lngLastColumn As Long
lngLastColumn = Cells.Find(What:="*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Dim cell As Range
For Each cell In Selection.Columns(1).Cells
    Range(cell, Cells(cell.Row, lngLastColumn)).FillRight
Nexthttps://stackoverflow.com/questions/51843415
复制相似问题