老师们好,我写了2个代码,本意是将非空单元格复制另一个区域,然后就编成了这样,有没有好的办法把表格里的2个宏编成一个啊,附件附上,求老师救命
'当单元格不为空时复制到……
Sub co()
Dim x As Integer
For x = 2 To 75
If Range("k" & x) <> "" Then
Range("i" & x).Copy Range("r" & x)
Range("j" & x).Copy Range("s" & x)
Range("k" & x).Copy Range("t" & x)
End If
Next x
End Sub
删除空的单元格
Sub 宏3()
Dim rg As Range
For x = 2 To 76
If Range("r" & x) = "" Then
Range("r" & x & ":" & "t" & x).Select
Selection.Delete Shift:=xlUp
End If
Next x
End Sub
Sub TEST()
Application.ScreenUpdating = False
W = Range("I65536").End(3).Row
Range("I2:K" & W).Copy Range("R2")
For i = W To 2 Step -1
If Cells(i, "T") = "" Then Range("R" & i & ":T" & i).Delete
Next
Application.ScreenUpdating = True
End Sub
Sub TEST()
Application.ScreenUpdating = False
W = Range("I65536").End(3).Row
Range("I2:K" & W).Copy Range("R2")
For i = W To 2 Step -1
If Cells(i, "T") = "" Then Range("R" & i & ":T" & i).Delete
Next
Application.ScreenUpdating = True
End Sub