Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Turning rows of equal number of columns into 1 continuous row

I've got a worksheet with about 50+ rows of 5-column's worth of numbers
(a
5x50 grid). I'm trying to turn this into 1 continuous row that uses
data
from A1, B1, C1, D1, E1, A2, B2, C2, D2, E2, A3, B3...


Befo

A1 B1 C1 D1 E1
A2 B2 C2 D2 E2
A3 B3 C3 D3 E3

After:
A1 B1 C1 D1 E1 A2 B2 C2 D2 E2 A3 B3 C3 D3 E3


Is there any way to automate some of this? Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Turning rows of equal number of columns into 1 continuous row

What do you mean, "some of this" ??? Try this.

Public Sub oneLoveUmmmRow()
Dim wsF As Worksheet, wsT As Worksheet
Dim rF As Range, rT As Range

' initialize
Set wsF = ActiveSheet
Set wsT = Sheets.Add
wsT.Name = "Results"
Set rF = wsF.Range("A1")
Set rT = wsT.Range("A1")

' rf loops through all the values in wf
' rt just moves across the sheet popping values until rf is done
Do While Not rF.Value = ""
Do While Not rF.Value = ""
rT.Value = rF.Value
Set rT = rT.Offset(0, 1)
Set rF = rF.Offset(0, 1) ' move rf one space right
Loop
Set rF = wsF.Range("A" & rF.Row + 1) ' move rf to the start of
the next row
Loop

' clean up
Set rF = Nothing
Set rT = Nothing
Set wsF = Nothing
Set wsT = Nothing
End Sub

chimerical wrote:
I've got a worksheet with about 50+ rows of 5-column's worth of numbers
(a
5x50 grid). I'm trying to turn this into 1 continuous row that uses
data
from A1, B1, C1, D1, E1, A2, B2, C2, D2, E2, A3, B3...


Befo

A1 B1 C1 D1 E1
A2 B2 C2 D2 E2
A3 B3 C3 D3 E3

After:
A1 B1 C1 D1 E1 A2 B2 C2 D2 E2 A3 B3 C3 D3 E3


Is there any way to automate some of this? 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
Cutting and pasting from rows into columns and visa versa. Pank New Users to Excel 2 November 8th 06 02:54 PM
find number in multiple columns and rows JLeoni Excel Worksheet Functions 1 October 25th 06 09:14 PM
turning rows into columns? Aoife101 Excel Discussion (Misc queries) 1 August 4th 06 12:43 PM
NUMBER OF ROWS IN A DYNAMIC RANGE Larry Excel Worksheet Functions 0 July 14th 06 09:19 PM
How do I change the number of columns and rows in a worksheet SteveK Excel Discussion (Misc queries) 2 October 27th 05 03:13 AM


All times are GMT +1. The time now is 06:14 PM.

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

About Us

"It's about Microsoft Excel"