PC Review


Reply
Thread Tools Rate Thread

Copy variable sized range to single column...

 
 
=?Utf-8?B?SmVk?=
Guest
Posts: n/a
 
      22nd Feb 2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZGtpbm4=?=
Guest
Posts: n/a
 
      22nd Feb 2007
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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill a variable sized range Joe Microsoft Excel Programming 5 5th Dec 2009 08:34 PM
Using variable sized range in CountIf() paulquinlan100@hotmail.com Microsoft Excel Misc 1 24th Oct 2007 11:15 AM
copy a range with known start column to variable end column =?Utf-8?B?TWF0aWxkYQ==?= Microsoft Excel Programming 2 2nd Aug 2006 04:55 PM
Copy column range of "single word" cells with spaces to a single c =?Utf-8?B?bmFzdGVjaA==?= Microsoft Excel Misc 3 15th Feb 2006 05:04 PM
Copy pasting a range in to a single column Hari Prasadh Microsoft Excel Programming 8 30th Jan 2005 05:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:02 PM.