erimhast83
New Member
- Joined
- Jan 3, 2018
- Messages
- 14
I am running the below code and getting an error at the end when the do untilempty is not working and the code runs until the third line and there are no more rows in the spreadsheet since column G had no data in any cells. Can someone please help me figure out the error in my coding. Thank you.
Do Until IsEmpty("D2:D")
Range("G2").End(xlDown).Select
ActiveCell.Offset(1, -3).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight).Offset(0, 3)).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(-1, 3).Select
Selection.Cut
ActiveCell.Offset(1, -1).Select
ActiveSheet.Paste
ActiveCell.Offset(-1, -1& - 1).Select
Range(Selection, Selection.End(xlToRight).Offset(0, -1)).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Loop
Do Until IsEmpty("D2:D")
Range("G2").End(xlDown).Select
ActiveCell.Offset(1, -3).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight).Offset(0, 3)).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(-1, 3).Select
Selection.Cut
ActiveCell.Offset(1, -1).Select
ActiveSheet.Paste
ActiveCell.Offset(-1, -1& - 1).Select
Range(Selection, Selection.End(xlToRight).Offset(0, -1)).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Loop