I receive a series of files with differing numbers of rows. The field names information are always the last row in the file and I would like to move it to the 1st row using a cut/paste insert command. Because the number of rows differs from file to file, I am using a do until loop to find the field names. I can't get the cut/paste to work, what am I doing wrong?
Here is an example of my code - The title for the 1st column is -77
Range("a1").Select
Do Until Selection.Value = ""
If Selection.Value = "-77" Then
Application.CutCopyMode = False
ActiveCell.EntireRow.Selection
Selection.Cut
Range("1:1").Select
Selection.Insert Shift:=xlDown
Else
End If
Selection.Offset(1, 0).Select
Loop
Here is an example of my code - The title for the 1st column is -77
Range("a1").Select
Do Until Selection.Value = ""
If Selection.Value = "-77" Then
Application.CutCopyMode = False
ActiveCell.EntireRow.Selection
Selection.Cut
Range("1:1").Select
Selection.Insert Shift:=xlDown
Else
End If
Selection.Offset(1, 0).Select
Loop