返回列表 上一主題 發帖

[發問] Borders屬性問題

[發問] Borders屬性問題

請問各位大大
以下是"刪除"按鈕的程度碼
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"  是什麼原因呢??

創新專安Pugh概念選擇.rar (25.65 KB)

寶寶

        靜思自在 : 站在半路,比走到目標更辛苦。
返回列表 上一主題