Copying All the Cell Contents to "A" Column

madhuchelliah

Board Regular
Joined
Nov 22, 2017
Messages
226
Office Version
  1. 2019
Platform
  1. Windows
Hello Guys, I have data in A column and scattered around randomly from B column to Z column. I want copy those data to A column one after one in A column. Please heads up. Thank you.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Z
Hello Guys, I have data in A column and scattered around randomly from B column to Z column. I want copy those data to A column one after one in A column. Please heads up. Thank you.
If this was your data, how should the list in Column A look afterwards...

OneAAA
TwoBBB
ThreeCCCDDD
FourEEE

<tbody>
</tbody>
 
Last edited:
Upvote 0
Hello Rick, Thanks for the response. I just want all the contents in the A column. it doesn't matter how the order is in A column. If it is easy to copy each column data one by one then see the result in the table below.

One
Two
Three
Four
BBB
CCC
DDD
AAA
EEE

<tbody>
</tbody>
 
Upvote 0
Hello Rick, Thanks for the response. I just want all the contents in the A column. it doesn't matter how the order is in A column. If it is easy to copy each column data one by one then see the result in the table below.

One
Two
Three
Four
BBB
CCC
DDD
AAA
EEE

<tbody>
</tbody>

Give this macro a try...
Code:
[table="width: 500"]
[tr]
	[td]Sub AllTextToColumnA()
  Dim LastCol As Long, Combined As String, Rng As Range
  Application.ScreenUpdating = False
  LastCol = Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column
  For Each Rng In ActiveSheet.UsedRange.Columns
    Rng.Cut Cells(Rows.Count, "A").End(xlUp).Offset(1)
  Next
  Columns("A").SpecialCells(xlBlanks).Delete xlShiftUp
  Application.ScreenUpdating = True
End Sub[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0
Give this macro a try...
Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sub AllTextToColumnA()
  Dim LastCol As Long, Combined As String, Rng As Range
  Application.ScreenUpdating = False
  LastCol = Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column
  For Each Rng In ActiveSheet.UsedRange.Columns
    Rng.Cut Cells(Rows.Count, "A").End(xlUp).Offset(1)
  Next
  Columns("A").SpecialCells(xlBlanks).Delete xlShiftUp
  Application.ScreenUpdating = True
End Sub[/TD]
[/TR]
</tbody>[/TABLE]


Hello Rick, I am getting the following error while running the code "The selection is not valid. make sure the copy and paste areas don't overlap unless they are the same size and shape". I can't figure out the issue. Could you please assist me to get rid of this?
 
Upvote 0
Hello Rick, I am getting the following error while running the code "The selection is not valid. make sure the copy and paste areas don't overlap unless they are the same size and shape". I can't figure out the issue. Could you please assist me to get rid of this?
Can you post a copy of the workbook (with the original data before running my code against it) to DropBox so that I can download it and follow how my code interacts with it while watching it execute?
 
Upvote 0
Hello Rick, I guess the data is not an issue. After getting error replace that sheet with new sheet, then the code runs perfectly. After some time it starts showing the same error. I found some dissimilarity during successful and unsuccessful attempts. During successful attempt i can select the entire column by clicking the heading but during unsuccessful attempt when error shows i cant able to select the entire column. Clicking on the heading doing nothing. Since the error also stating that invalid selection the problem might be with the selection. BTW i cant able to share data its confidential one. Thank you.
 
Upvote 0

Forum statistics

Threads
1,216,207
Messages
6,129,503
Members
449,512
Latest member
Wabd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top