1
小計兩列,然後使用查找替換列Z也替換列Q中的公式。 如何將其限制爲僅列Z?我試着使用選擇可見單元格,但它仍然改變柱Q.選定的列Z:Z替換公式,但也替換列Q中的公式:Q爲什麼?
Selection.Subtotal GroupBy:=11, Function:=xlSum, TotalList:=Array(17, 26) _
, Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Columns("Z:Z").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Cells.Replace What:="SUBTOTAL(9", Replacement:="SUBTOTAL(1", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
我的猜測是Q引用了你正在改變的值。 –