View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
dkinn dkinn is offline
external usenet poster
 
Posts: 30
Default Copy variable sized range to single column...

Hi Jed;

Here is one way to copy a selection to a single column

Sub Copytest()
'Copies from current selection
Cnt = Selection.Cells.Count
'My other workbook
With Workbooks("Book2").Worksheets("Sheet1")

For Item = 1 To Cnt
'Pastes to 2nd workbook
Selection.Cells(Item).Copy .Cells(Item, "A")
Next Item
End With
End Sub


hope this helps

David

"Jed" wrote:

Hello,

I have users selecting a range which I'm using on another spreadsheet, but I
need a way to have all of the cells, wherever they come from copied over into
one single column where they can be sorted, formatted etc.

How can I do this in VBA? Any suggestions would be very welcome.

Thanks in advance,
Jed