Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Could one of you experts answer an easy question...

Hi guys--

Simple problem for you. I've imported a dataset into Excel
where each record consists of n variables, but instead of
each record's variables being distributed into columns of
the same row (what I want), they are all in column A on
different rows.

That is, rows 1 through n comprise record 1, rows n+1
through 2n comprise record 2, etc. (Everything is in the
same column, and there are a total of (number of variables
per record)*(number of records) rows.

I'd like to take the values in rows 1 through n and put
them into columns A through (n.th letter) in row 1 thus
creating a normal single record. Ditto for the rest of the
dataset, rows n+1 through 2n into columns A through (n.th
letter) in row 2.

I'll thank you guys in advance since you've always come up
with a solution to my problems :)

Bryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Could one of you experts answer an easy question...

Select your sata in column A, and run this macro. Be sure to adjust
RowsPerRec to your row count per record.

Const RowsPerRec As Integer = 6

Sub a()
Dim SrcRg As Range
Dim Cell As Range, ColNum As Integer
Dim Counter As Long
Application.ScreenUpdating = False
Set SrcRg = Selection
Worksheets.Add
For Each Cell In SrcRg
Cells(Int(Counter / RowsPerRec) + 1, (Counter Mod RowsPerRec + 1)).Value
= Cell.Value
Counter = Counter + 1
Next
End Sub


--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Could one of you experts answer an easy question...

How are you importing your dataset?

Have you tried using

Application.Transpose(rs)


--
Regards,
Tom Ogilvy


"Bryan" wrote in message
...
Hi guys--

Simple problem for you. I've imported a dataset into Excel
where each record consists of n variables, but instead of
each record's variables being distributed into columns of
the same row (what I want), they are all in column A on
different rows.

That is, rows 1 through n comprise record 1, rows n+1
through 2n comprise record 2, etc. (Everything is in the
same column, and there are a total of (number of variables
per record)*(number of records) rows.

I'd like to take the values in rows 1 through n and put
them into columns A through (n.th letter) in row 1 thus
creating a normal single record. Ditto for the rest of the
dataset, rows n+1 through 2n into columns A through (n.th
letter) in row 2.

I'll thank you guys in advance since you've always come up
with a solution to my problems :)

Bryan



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
An easy answer I'm sure, so why am I stuck? Dan the Man[_2_] Excel Discussion (Misc queries) 5 September 21st 08 05:25 PM
This should be easy, but can't find an answer...requesting your in Lisa Excel Worksheet Functions 1 January 23rd 08 06:02 AM
Easy for the experts: Lookup,index,match.... DDD Excel Worksheet Functions 6 October 26th 06 03:15 PM
Another Filtering Question for Excel 2007 Experts Rebecca New Users to Excel 2 June 14th 06 12:44 AM
Question for the real experts! diepenbos Excel Discussion (Misc queries) 2 March 16th 05 03:21 PM


All times are GMT +1. The time now is 09:38 AM.

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"