0
我有一個excel工作簿,其範圍是動態的。我想找到這個動態範圍的最大值。這裏是我的代碼,我想找到的最大值ROUNDUP動態範圍內的VBA公式
Set SearchRng1 = Cells(2, 2)
Debug.Print SearchRng1.Address
Set SearchRng2 = Cells(LastRow, j + 2)
Debug.Print SearchRng2.Address
With hidden3ws
Worksheets("Hidden3").Activate
Range("B2").Formula = "=ROUNDUP(MAX('Incre_Calc_A'!SearchRng1:SearchRng2),-1)"
End With
但是這個輸出是=#NAME塊? 有人可以幫我用這段代碼,所以我可以得到一個實際的價值?提前致謝!
指的工作表上的「Hidden3」單元格時不要使用'工作表(「Hidden3」)Activate' ....使用'。工作表(「Hidden3」)。範圍(「B2」)。Formula = ....'直接引用單元格 – jsotola