作者zesy (認識新朋友!!)
站內Visual_Basic
標題[VBA ] 將某一列的某個範圍清空
時間Wed Dec 28 10:13:43 2011
例
a b c d e f g h i j
1 # # # #
2 # # # #
3 # # # #
4
5
6
7
8
x為變數
Worksheets("統計表").Range(Cells(x, 2), Cells(x, 5)).Clear
請問這樣的寫法有錯嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 1.170.154.191
推 ClubT:.Range(Cells(x, 2), Cells(x, 5)).ClearContents 12/28 10:52
→ zesy:還是會出現應用程式或物件定義上的錯誤 12/28 12:20
→ MOONRAKER:for each c in range(...) : c.formula="" : next 12/28 12:58
推 olycats:我試都可以耶 會不會是你的x變數有問題? 12/28 22:57