Cutting and pasting 90+ columns into 1 column
Closed
beladrian
-
25 Jun 2009 à 23:01
Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 - 29 Aug 2009 à 04:34
Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 - 29 Aug 2009 à 04:34
Related:
- Cutting and pasting 90+ columns into 1 column
- Tentacle locker 1 - Download - Adult games
- Igi 1 - Download - Shooters
- Excel column number - Guide
- Fnia 1 apk - Download - Adult games
- My cute roommate 1 - Download - Adult games
4 responses
Hi Excelguru,
Thanks for your prompt reply!
Is this the way it should look?
I am getting a runtime error.
Would this loop through all the other other 90+ columns in that sheet automatically?
Thanks again in advance!
Sub CombineColumns()
'Copy column b to Column a
Columns("b").Copy Destination:=Columns("A")
NewRowA = Range("A" & Rows.Count).End(xlUp).Row + 1
LastRowB = Range("c" & Rows.Count).End(xlUp).Row
Set CopyRange = Range("c1:c" & LastRowc)
CopyRange.Cut
Range("A" & NewRowA).Select
ActiveSheet.Paste
NewRowA = Range("A" & Rows.Count).End(xlUp).Row + 1
LastRowc = Range("d" & Rows.Count).End(xlUp).Row
Set CopyRange = Range("d1:d" & LastRowd)
CopyRange.Cut
Range("A" & NewRowA).Select
ActiveSheet.Paste
End Sub
Thanks for your prompt reply!
Is this the way it should look?
I am getting a runtime error.
Would this loop through all the other other 90+ columns in that sheet automatically?
Thanks again in advance!
Sub CombineColumns()
'Copy column b to Column a
Columns("b").Copy Destination:=Columns("A")
NewRowA = Range("A" & Rows.Count).End(xlUp).Row + 1
LastRowB = Range("c" & Rows.Count).End(xlUp).Row
Set CopyRange = Range("c1:c" & LastRowc)
CopyRange.Cut
Range("A" & NewRowA).Select
ActiveSheet.Paste
NewRowA = Range("A" & Rows.Count).End(xlUp).Row + 1
LastRowc = Range("d" & Rows.Count).End(xlUp).Row
Set CopyRange = Range("d1:d" & LastRowd)
CopyRange.Cut
Range("A" & NewRowA).Select
ActiveSheet.Paste
End Sub
Excelguru
Posts
261
Registration date
Saturday 11 April 2009
Status
Member
Last seen
21 June 2011
307
27 Jun 2009 à 08:59
27 Jun 2009 à 08:59
Hi beladrian
instead of CopyRange.Copy Destination:=Range("A" & NewRowA) use
instead of CopyRange.Copy Destination:=Range("A" & NewRowA) use
CopyRange.Cut
Range("A" & NewRowA).Select
ActiveSheet.Paste
Excelguru
Posts
261
Registration date
Saturday 11 April 2009
Status
Member
Last seen
21 June 2011
307
29 Jun 2009 à 04:23
29 Jun 2009 à 04:23
Hi beladrian
You have made a spelling mistake in the code
LastRowc = Range("d" & Rows.Count).End(xlUp).Row
Set CopyRange = Range("d1:d" & LastRowd)
You have made a spelling mistake in the code
LastRowc = Range("d" & Rows.Count).End(xlUp).Row
Set CopyRange = Range("d1:d" & LastRowd)
Excelguru
Posts
261
Registration date
Saturday 11 April 2009
Status
Member
Last seen
21 June 2011
307
29 Aug 2009 à 04:34
29 Aug 2009 à 04:34
LastRowc = Range("d" & Rows.Count).End(xlUp).Row
Set CopyRange = Range("d1:d" & LastRowd)
I just meant that instead of LastRowc he used LastRowd in the second line.
This caused the error as excel could not find the value of LastRowd and hence it took the value as zero
There is no zeroth row or column in excel
Set CopyRange = Range("d1:d" & LastRowd)
I just meant that instead of LastRowc he used LastRowd in the second line.
This caused the error as excel could not find the value of LastRowd and hence it took the value as zero
There is no zeroth row or column in excel