
程序代码:
Sub test()
'
SetMove ThisWorkbook.Worksheets(1)
End Sub
Function SetMove(ByVal sht As Worksheet)
Dim rng As Range
Dim i, k, j, m As Integer
i = sht.Cells(Rows.Count, "ay").End(xlUp).Row
k = sht.Cells(1, "ay").End(xlDown).Row
For j = k To i
If sht.Cells(j, 3).Value = "" Then
m = sht.Cells(j, 1).End(xlToRight).Column
Set rng = Range(Cells(j, m), Cells(j, "ay"))
rng.Select
rng.Cut
sht.Cells(j, "c").Select
sht.Paste
End If
Next
End Function
[此贴子已经被作者于2019-9-9 10:40编辑过]