first vba

来源:互联网 发布:unity3d 鼠标中键平移 编辑:程序博客网 时间:2024/06/05 10:32
Sub moveCode()
'获取行
Dim iRows As Long
iRows = Sheets(1).UsedRange.Rows.Count
'循环处理 第一行不为空的数据全部放到D列来
For i = 1 To iRows
    If Sheets(1).Cells(i, 1) <> "" Then
    Sheets(1).Cells(i, 4).Value = Sheets(1).Cells(i, 1).Value
    Sheets(1).Cells(i, 1).Value = Null
    End If
Next
End Sub
0 0
原创粉丝点击