- 帖子
- 80
- 主題
- 27
- 精華
- 0
- 積分
- 108
- 點名
- 0
- 作業系統
- windows
- 軟體版本
- 2007
- 閱讀權限
- 20
- 性別
- 女
- 註冊時間
- 2012-3-6
- 最後登錄
- 2012-8-23
|
請問各位大大
以下是"刪除"按鈕的程度碼
Private Sub CommandButton2_Click()
Dim a As Integer
Dim b As Integer
Dim xR As Integer
Dim xT As Integer
Dim gyou As Integer
xR = ActiveCell.Row
xT = ActiveCell.Column
a = Range("A1").Value
b = Range("A2").Value
If xR = 1 And xT > 2 And xT <= a + 2 Then
gyou = ActiveCell.Column
ActiveSheet.Columns(gyou).Delete
Range("A1").Value = Range("A1").Value - 1
a = Range("A1").Value
ElseIf xR > 1 And xR <= b + 1 Then
Cells(xR, "B").Resize(, a + 2).Delete xlUp
Range("A2").Value = Range("A2").Value - 1
b = Range("A2").Value
End If
Range(Cells(1, 2), Cells(b + 4, a + 2)).Borders(xlEdgeRight).Weight = xlThick
Range(Cells(1, 2), Cells(b + 4, a + 2)).Borders(xlEdgeLeft).Weight = xlThick
Range(Cells(1, 2), Cells(b + 4, a + 2)).Borders(xlEdgeBottom).Weight = xlThick
Range(Cells(1, 2), Cells(1, a + 2)).Borders(xlEdgeBottom).Weight = xlThick
End Sub
執行後出現"無法設定種類Borders的屬性Weight" 是什麼原因呢?? |
|