PC Review


Reply
Thread Tools Rate Thread

How to copy data from different columns in an Excel to one column

 
 
Priya Gautam
Guest
Posts: n/a
 
      18th Mar 2008
How to copy data from different columns in an Excel to one column at once.
For example if i have data spread from column A to Z spread over 100 rows.
How do i bring all the values to column A.
 
Reply With Quote
 
 
 
 
filo666
Guest
Posts: n/a
 
      18th Mar 2008
please select your range and run this code:

Sub concolumn()
Dim arr1() As Variant
Dim cnt1, cnt2, a, aa, aaa, b, bb, bbb As Integer
cnt1 = 1
aa = Selection.Rows.Count
bb = Selection.Columns.Count
aaa = Selection.Row - 1
bbb = Selection.Column - 1
For b = 1 To bb
For a = 1 To aa
Cells(a + aaa, b + bbb).Select
If Cells(a + aaa, b + bbb) <> Empty Then
ReDim Preserve arr1(cnt1)
arr1(cnt1) = Cells(a + aaa, b + bbb)
cnt1 = cnt1 + 1
End If
Next
Next
For cnt2 = 1 To UBound(arr1)
Cells(cnt2, 1) = arr1(cnt2)
Next
End Sub

"Priya Gautam" wrote:

> How to copy data from different columns in an Excel to one column at once.
> For example if i have data spread from column A to Z spread over 100 rows.
> How do i bring all the values to column A.

 
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
Copy data from multiple columns and populate it in another sheet in one column,, QuickLearner Microsoft Excel Programming 1 11th Oct 2009 02:26 PM
How do I maintain columns when I copy JMP data into Excel? =?Utf-8?B?TVBUZmFu?= Microsoft Excel Misc 0 22nd May 2006 09:38 PM
How to Copy and Paste Several Columns of Data into Excel... ? =?Utf-8?B?TV9GTEVNSU5H?= Microsoft Excel Misc 3 18th May 2006 04:35 PM
How do i copy columns of data in notepad into excel? =?Utf-8?B?Sko=?= Microsoft Excel Misc 1 10th Feb 2005 09:21 PM
Copy Excel data content listed in 3 columns into a single column =?Utf-8?B?bW9vb3Jyb25h?= Microsoft Excel Programming 1 12th Jan 2005 04:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:04 AM.