View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ML ML is offline
external usenet poster
 
Posts: 57
Default Macro to copy nonadjacent range and paste

The macro aims to select whatever in column A and whatever in column C, then
copy and paste to a new workbook as column A and B. Since the number of rows
in column A and C are uncertain, I have to use End Down to select the cells.
However, the marco below only copy and paste column A but not C. What's
wrong?

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A1:A5,C1").Select
Range("C1").Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste