儲存格1 = IF(AD395=0,"",IF(AI395=0,0,SUM(AM395:AM395)/SUM(AI395:AI395)))
儲存格1 copy 到 儲存格2 (公式沒變)
儲存格2 = IF(AD395=0,"",IF(AI395=0,0,SUM(AM395:AM395)/SUM(AI395:AI395)))
方法
1.公式前面加個單引號,然後複製到需要的單元格。再查找替換掉單引號 ===>這麻煩
我寫一個簡單程序
Sub 絕對位址copy() '請先用mouse選擇複製的範圍
Dim rng As Range
Set rng = Selection
a = InputBox("輸入開始位址") '例如 A1
b = InputBox("輸入結束位址") '例如 G1
Range(a & ":" & b) = Selection.Formula
End Sub
用mouse選擇複製的範圍, 目的輸入的範圍的儲存格個數最好一樣作者: t8899 時間: 2014-8-24 12:25
再改一下新的版本 (不用輸入結束位址)
Sub 絕對位址copy() '請用mouse先選擇複製的範圍
Dim rng As Range, a, z, r, rr
Set rng = Selection
a = Selection.Address(0, 0)
z = InputBox("輸入開始位址")
Set r = Range(z).Offset(rng.Rows.Count - 1, rng.Columns.Count - 1)
Set rr = Range(z)
Range(rr.Address, r.Address) = Selection.Formula
End Sub作者: ML089 時間: 2014-8-24 15:31