So I have a master list of raw data which is extensive and too much to handle! I extracted only the relevant columns and worked with them, on a new sheet.
But now I also want to add in 3 additional columns (from the raw data list). I figured I could do this by inserting 3 blank columns in my newer sheet, (I added them in B,C,D) then copy/pasting the data from the old sheet into the new one.
However, no matter how I've done this, it seems to weirdly shift over ALL of my current data in the new sheet fairly far to the right (see attached pic). Why does it do this? How can I get it just to be copy/pasted into the basic columns I inserted, so that the data is together?
Note: It works fine when I do it by hand/am recording the macro, but it does the shift-over thing whenever I try to run the macro or use it on other sheets.
Any help is appreciated. Thanks!
Sub MacroAddColumnData
Sheets("Line5").Select
Columns("B:B").Select
Range("B2").Activate
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("Raw Data").Select
Range("G1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Line5").Select
Range("B2").Select
ActiveSheet.Paste
Sheets("Raw Data").Select
Range("I1").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Line5").Select
Range("C2").Select
ActiveSheet.Paste
Sheets("Raw Data").Select
Range("J1").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Line5").Select
Range("D2").Select
ActiveSheet.Paste
End Sub
Bookmarks