- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
6#
發表於 2014-5-21 15:05
| 只看該作者
回復 4# owen06 - Public mysize As Range '模組頂端制定為此模組的公用變數,其他模組的程序可使用此變數
- 'Dim mysize As Range '模組頂端制定為此模組的私用變數,僅此模組的程序可使用此變數,其他模組的程序不可使用此變數
- Private Sub CommandButton1_Click()
- 'Dim mysize As Range '此程序的私用變數,僅此程序中可用
- k1 = [I2].Value
- k2 = [i3].Value
- Set mysize = [B2].Resize(k1, k2)
- mysize.clear
- End Sub
- Private Sub CommandButton2_Click()
- 'Dim mysize As Range
- k1 = [I2].Value
- k2 = [i3].Value
- Set mysize = [B2].Resize(k1, k2)
- With mysize
- .Borders.LineStyle = xlContinuous
- .Interior.ColorIndex = 37
- .VerticalAlignment = xlCenter
- .HorizontalAlignment = xlCenter
- End With
- mysize.Cells(1).Select
- End Sub
- '後面的CommandButton??_Click 不在需要了
- Private Sub CommandButton10_Click()
- ActiveCell = CommandButton10.Caption
- End Sub
複製代碼 |
|