½Ð°Ý¦U¦ì¤j¤j
¥H¤U¬O"§R°£"«ö¶sªºµ{«×½X
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