作者:于浮浅 | 来源:互联网 | 2023-07-11 19:27
This is what I have:
这就是我所拥有的:
And my probleme is simple: I want to copy all rows Under "Maintenance" (C8) in worksheet 2, BUT I want it to work even if we delete some rows above "Maintenance" (C8).
我的问题很简单:我想在工作表2中“维护”(C8)下复制所有行,但即使我们删除了“维护”(C8)上面的一些行,我也希望它能工作。
for example:
例如:
because it changes the start of the copy. (from 8 to end before, and 5 to end after)
因为它改变了拷贝的开始。(8到结束前,5到结束后)
Here is my code :
这是我的代码:
n = 8
j = 2
Sheets("1").Select
Do While Cells(n, 1) <> "x"
If Cells(n, 1) <> "x" Then
Sheets("2").Cells(j, 2) = Sheets("1").Cells(n, 2)
Sheets("2").Cells(j, 3) = Sheets("1").Cells(n, 3)
j = j + 1
End If
n = n + 1
Loop
1 个解决方案