1
程序的功能是找到第一行有一个空单元格,该单元格的旁边是需要剪切并粘贴到第26列上一行的数字。在Excel VBA中剪切和粘贴单元格
- 我试图运行循环遍历整个工作表并删除行复制和粘贴。
- 如果里面已经有数据,将跳过它并继续。
-The第二种方法是我最有前途的,但我似乎无法找出如何运行单元格的格式(X,1)
(方法一)
Dim x As Integer
x = 1
this = x - 1
rowdelete = x
If Cells(x, 1) = "" Then
Cells(x, 1).Select.Cut
Cells(x - 1, 26).PasteSpecial
Rows([rowdelete]).EntireRow.Delete
End If
(方法二)
Dim x As Integer
x = 1
this = x - 1
rowdelete = x
If Cells(x, 1) = "" Then
Cells(x, 1).Select.Cut
Cells(x - 1, 26).PasteSpecial
Rows([rowdelete]).EntireRow.Delete
End If