用VBA如何写入和删除矩阵型单元格数据
在工作中我们经常会碰到写入或删除矩阵单元格类型的数据,这里就为你提供更简单的方法
操作方法
- 01
写入矩阵型单元格数据 Sub CommandButton写入_click() Dim i As Integer, h As Integer, k As Integer, f As Integer k = 1 f = 1 For i = 1 To 5 For h = 1 To 23 Cells(k, h) = f h = h + 1 And h <= 23 f = f + 1 Next h k = k + 3 Next i End Sub
- 02
删除矩阵型单元格数据 Sub CommandButton删除_Click() Dim i As Integer, h As Integer, k As Integer k = 1 For i = 1 To 5 For h = 1 To 23 Cells(k, h).ClearContents h = h + 1 And h <= 23 Next h k = k + 3 Next i End Sub
赞 (0)