Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Convert Multiple Column Values into 1 column

Can you convert a worksheet with multiple columns and multiple rows of data
into 1 column?

CURRENT WORKSHEET STRUCTURE(assume A1=_-Insert, A2=MHS,etc.)

_-Insert _-Insert
MHS MHS-PROP
225,955,0 0,940,0
1.00 1.00
1.00 1.00
0.00 0.00

DESIRED RESULT

_-Insert
MHS
225,955,0
1.00
1.00
0.00
_-Insert
MHS-PROP
0,940,0
1.00
1.00
0.00

Any help is appreciated. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Convert Multiple Column Values into 1 column

Sub OneColumnV2()
''''''''''''''''''''''''''''''''''''''''''
'Macro to copy columns of variable length'
'into 1 continous column in a new sheet '
'Modified 17 FEb 2006 by Bernie Dietrick
''''''''''''''''''''''''''''''''''''''''''
Dim iLastcol As Long
Dim iLastRow As Long
Dim jLastrow As Long
Dim ColNdx As Long
Dim WS As Worksheet
Dim myRng As Range
Dim ExcludeBlanks As Boolean
Dim myCell As Range

ExcludeBlanks = (MsgBox("Exclude Blanks", vbYesNo) = vbYes)
Set WS = ActiveSheet
iLastcol = WS.Cells(1, WS.Columns.Count).End(xlToLeft).Column
On Error Resume Next

Application.DisplayAlerts = False
Worksheets("Alldata").Delete
Application.DisplayAlerts = True

Sheets.Add.Name = "Alldata"

For ColNdx = 1 To iLastcol

iLastRow = WS.Cells(WS.Rows.Count, ColNdx).End(xlUp).Row

Set myRng = WS.Range(WS.Cells(1, ColNdx), _
WS.Cells(iLastRow, ColNdx))

If ExcludeBlanks Then
For Each myCell In myRng
If myCell.Value < "" Then
jLastrow = Sheets("Alldata").Cells(Rows.Count, 1) _
.End(xlUp).Row
myCell.Copy
Sheets("Alldata").Cells(jLastrow + 1, 1) _
.PasteSpecial xlPasteValues
End If
Next myCell
Else
myRng.Copy
jLastrow = Sheets("Alldata").Cells(Rows.Count, 1) _
.End(xlUp).Row
myCell.Copy
Sheets("Alldata").Cells(jLastrow + 1, 1) _
.PasteSpecial xlPasteValues
End If
Next

Sheets("Alldata").Rows("1:1").EntireRow.Delete

WS.Activate
End Sub


Gord Dibben MS Excel MVP

On Sat, 10 Nov 2007 12:06:01 -0800, Darian
wrote:

Can you convert a worksheet with multiple columns and multiple rows of data
into 1 column?

CURRENT WORKSHEET STRUCTURE(assume A1=_-Insert, A2=MHS,etc.)

_-Insert _-Insert
MHS MHS-PROP
225,955,0 0,940,0
1.00 1.00
1.00 1.00
0.00 0.00

DESIRED RESULT

_-Insert
MHS
225,955,0
1.00
1.00
0.00
_-Insert
MHS-PROP
0,940,0
1.00
1.00
0.00

Any help is appreciated. Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Convert Multiple Column Values into 1 column

=OFFSET($A$1,MOD(ROWS($A$1:A1)-1,COUNTA($A$1:$A$6)),INT((ROWS($A$1:A1)-1)/COUNTA($A$1:$A$6)))

Copy down as far as needed.


"Darian" wrote:

Can you convert a worksheet with multiple columns and multiple rows of data
into 1 column?

CURRENT WORKSHEET STRUCTURE(assume A1=_-Insert, A2=MHS,etc.)

_-Insert _-Insert
MHS MHS-PROP
225,955,0 0,940,0
1.00 1.00
1.00 1.00
0.00 0.00

DESIRED RESULT

_-Insert
MHS
225,955,0
1.00
1.00
0.00
_-Insert
MHS-PROP
0,940,0
1.00
1.00
0.00

Any help is appreciated. Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Convert Multiple Column Values into 1 column

Thanks,

This is EXACTLY what I have been looking for!

Darian

"Teethless mama" wrote:

=OFFSET($A$1,MOD(ROWS($A$1:A1)-1,COUNTA($A$1:$A$6)),INT((ROWS($A$1:A1)-1)/COUNTA($A$1:$A$6)))

Copy down as far as needed.


"Darian" wrote:

Can you convert a worksheet with multiple columns and multiple rows of data
into 1 column?

CURRENT WORKSHEET STRUCTURE(assume A1=_-Insert, A2=MHS,etc.)

_-Insert _-Insert
MHS MHS-PROP
225,955,0 0,940,0
1.00 1.00
1.00 1.00
0.00 0.00

DESIRED RESULT

_-Insert
MHS
225,955,0
1.00
1.00
0.00
_-Insert
MHS-PROP
0,940,0
1.00
1.00
0.00

Any help is appreciated. Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I convert a column of numbers into comma separated values . cattom44 Excel Worksheet Functions 2 August 3rd 07 09:48 PM
Adding multiple values in one column based on multiple values of the same value (text) in another column [email protected] Excel Discussion (Misc queries) 1 May 16th 07 06:02 PM
To find Multiple values in column B for a unique value in column A kishdaba Excel Worksheet Functions 2 November 14th 06 12:49 PM
convert column values charles Excel Worksheet Functions 5 June 15th 06 07:13 PM
How do you convert numbers as "text" to values for a long column . geoexcel Excel Discussion (Misc queries) 2 February 27th 05 04:31 PM


All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"