標題:
請教删除指定儲存格內容更簡單公式
[打印本頁]
作者:
笨小孩
時間:
2011-11-14 00:34
標題:
請教删除指定儲存格內容更簡單公式
If Answer = vbOK Then
all = 0
Call round(3, 15)
Call round2(18, 30)
Call round(33, 45)
Call round2(49, 61)
Call round(64, 76)
Call round2(79, 91)
Call round(95, 107)
Call round2(110, 122)
Call round(125, 137)
Call round2(141, 153)
Call round(156, 168)
Call round2(171, 183)
Call round(187, 199)
Call round2(202, 214)
Call round(217, 229)
Call round2(233, 245)
Call round2(248, 260)
Call round(263, 275)
Call round2(279, 291)
Call round(294, 306)
Call round2(309, 321)
Call round(325, 337)
Call round2(340, 352)
Call round(355, 367)
Call round2(371, 383)
Call round(386, 398)
Call round2(401, 413)
Call round(417, 429)
Call round2(432, 444)
Call round(447, 459)
Call round2(463, 475)
Call round(478, 490)
Call round2(493, 505)
End If
以上只是1個組別公式,共要删除11組別內容,希望有更簡單方法完成,謝謝
作者:
笨小孩
時間:
2011-11-14 00:37
Sub round(ByVal first, ByVal second)
r = 0
For r = first To second
Cells(r, 43).ClearContents
Cells(r, 45).ClearContents
Cells(r, 47).ClearContents
Cells(r, 49).ClearContents
Cells(r, 54).ClearContents
Cells(r, 56).ClearContents
Cells(r, 58).ClearContents
Cells(r, 60).ClearContents
Cells(r, 65).ClearContents
Cells(r, 67).ClearContents
Cells(r, 69).ClearContents
Cells(r, 71).ClearContents
Cells(r, 76).ClearContents
Cells(r, 78).ClearContents
Cells(r, 80).ClearContents
Cells(r, 82).ClearContents
Cells(r, 87).ClearContents
Cells(r, 89).ClearContents
Cells(r, 91).ClearContents
Cells(r, 93).ClearContents
Next
End Sub
Sub round2(ByVal first, ByVal second)
r = 0
For r = first To second
Cells(r, 43).ClearContents
Cells(r, 45).ClearContents
Cells(r, 47).ClearContents
Cells(r, 49).ClearContents
Cells(r, 54).ClearContents
Cells(r, 56).ClearContents
Cells(r, 58).ClearContents
Cells(r, 60).ClearContents
Cells(r, 65).ClearContents
Cells(r, 67).ClearContents
Cells(r, 69).ClearContents
Cells(r, 71).ClearContents
Cells(r, 76).ClearContents
Cells(r, 78).ClearContents
Cells(r, 80).ClearContents
Cells(r, 82).ClearContents
Cells(r, 87).ClearContents
Cells(r, 89).ClearContents
Cells(r, 91).ClearContents
Cells(r, 93).ClearContents
Next
End Sub
還有欄位
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)