Quantcast
Channel: Microsoft forum - dslreports.com
Viewing all articles
Browse latest Browse all 8524

[Excel] Macro is copying one extra column

$
0
0
I have the following, recorded and slightly hand edited macro: Sub XY()'' XY Macro' Sheets("Data").Select Columns("A:A").Select Selection.Copy Sheets("XY").Select Columns("A:A").Select ActiveSheet.Paste' Sheets("Data").Select Columns("B:B").Select Selection.Copy Sheets("XY").Select Columns("B:B").Select ActiveSheet.Paste' Sheets("Data").Select Columns("C:C").Select Selection.Copy Sheets("XY").Select Columns("C:C").Select ActiveSheet.Paste' Sheets("Data").Select Columns("N:N").Select Selection.Copy Sheets("XY").Select Columns("D:D").Select ActiveSheet.Paste' Sheets("Data").Select Columns("P:P").Select Selection.Copy Sheets("XY").Select Columns("E:E").Select ActiveSheet.Paste' Sheets("Data").Select Columns("R:R").Select Selection.Copy Sheets("XY").Select Columns("F:F").Select ActiveSheet.Paste End Sub This is supposed to copy a grand total 6 columns from the "Data" sheet into "XY" sheet. However, it copies one extra column ("S:S") and places it into ("G:G"). Which, unfortunately, messes up everything I do after the copying. Any idea why Excel might do that? I'm about to break down and explicitly delete ("G:G") which should've been empty in the first place. :( TIA -- .sig

Viewing all articles
Browse latest Browse all 8524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>