Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Helpe me NEwbie
Hello People, I'm new I need help with this complicated thing Say I have string values of these in each column: Column1 Column2 ---------------------------- definition1 meaning1 definition2 meaning2 I will need transform it to: definition1 meaning1 definition2 meaning2 And, let the procedure also work for rows with multiple values like: a b c d f g h i To turn like this: a b c d e f g h i Can you help me? Thanks in ADVAnce!!! -- Ambrosia ------------------------------------------------------------------------ Ambrosia's Profile: http://www.excelforum.com/member.php...o&userid=28146 View this thread: http://www.excelforum.com/showthread...hreadid=478525 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Helpe me NEwbie
If you don't have many rows, you could copy the first row, then select a
different sheet and click edit/paste special - check transpose. This will put your rows into columns, but you have to do it for each row. You could also try pasting this macro into a VBA module, then select your table and run the macro. Be sure to back up your data and make sure there is nothing below your data table that might get overwritten. Sub DataToColumn() Dim DataArray() Dim i As Long Dim t As Long If Selection.Columns.Count * _ Selection.Rows.Count = 1 Then _ Exit Sub ReDim DataArray(1 To Selection.Rows.Count, _ 1 To Selection.Columns.Count) DataArray = Selection.Value Selection.Delete For i = 1 To UBound(DataArray, 1) For t = 1 To UBound(DataArray, 2) ActiveCell.Offset((UBound(DataArray, 2) * _ (i - 1)) + t - 1, 0).Value = DataArray(i, t) Next t Next i End Sub "Ambrosia" wrote: Hello People, I'm new I need help with this complicated thing Say I have string values of these in each column: Column1 Column2 ---------------------------- definition1 meaning1 definition2 meaning2 I will need transform it to: definition1 meaning1 definition2 meaning2 And, let the procedure also work for rows with multiple values like: a b c d f g h i To turn like this: a b c d e f g h i Can you help me? Thanks in ADVAnce!!! -- Ambrosia ------------------------------------------------------------------------ Ambrosia's Profile: http://www.excelforum.com/member.php...o&userid=28146 View this thread: http://www.excelforum.com/showthread...hreadid=478525 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Helpe me NEwbie
Omigosh! Thanks a lot for your help!! I'm very happy that my first post was responded to!!! (And all this time I was uselessly trying to figure out how this works for hours!) God bless you! -- Ambrosia ------------------------------------------------------------------------ Ambrosia's Profile: http://www.excelforum.com/member.php...o&userid=28146 View this thread: http://www.excelforum.com/showthread...hreadid=478525 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
NEWBIE | Excel Discussion (Misc queries) | |||
Real Newbie newbie question | New Users to Excel | |||
Very newbie | Excel Programming | |||
I'm a newbie | Excel Programming | |||
Newbie Help | Excel Programming |