Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default stacking data

I have some data that I would like to stack. It has a few columns of
information and then nine statistics for a varying number of splits.
For example, for the first row it would be something like

A F G H I J K
name average average average stdev stdev stdev

where the average is listed for split1, split2, split3 and so on for
stdev. I would like to stack this so that it looks like

A B C D E
1 name average
2 name stdev

where C, D, and E now contain the average and stdev of the three
splits.

I am having a hard time doing this so that a) it does not take forever
(800 rows) and b) it is easy to code. For example, I tried using for
each row but it became difficult to deal with the inserting and
keeping track of where the for statement was. I am now in a loop but
still working with set range and I am trying to determine how to
delete a range of cells in a certain row. If I have a range named
rngdata and I want to work with one row say rngdata.row(1), how do I
access the 8-16th columns of this row? Here is a bit of code to help
with visualization. NumStat, NumSplit, NumParam, and NumCols are all
integers as are i and j.

Set RngData = Range(Range("A1").Offset(NumCat + 1, 0), _
Range("A1").Offset(NumCat + NumParam - 1, NumSplit * NumStat +
NumCols))
For i = 1 To NumParam * NumStat + NumStat
j = (i - 1) Mod NumStat
If j < 0 Then
RngData.Rows(i - 1).Copy
RngData.Rows(i).Insert shift:=xlDown
With RngData
.Cells(i, NumCols + 1) = StrStats(j)
.Rows(i).Font.Bold = False
???.Delete shift:=xlShiftToLeft 'here add access to
columns
End With
Else
RngData.Cells(i, 8) = StrStats(j)
RngData.Rows(i).Font.Bold = True
End If
Next i

Would it be faster to do this as an array? If so, how would I do
that?

Thanks in advance
H
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
Stacking data to show same number but different colors wiggy Charts and Charting in Excel 1 August 18th 09 06:20 PM
Stacking data without stacking everything JMCostello Charts and Charting in Excel 1 August 24th 07 12:24 AM
Line column on 2 axes - stacked columns data not stacking [email protected] Charts and Charting in Excel 6 March 2nd 07 08:52 AM
Stacking data from within a series within a bar chart Hosley Charts and Charting in Excel 1 January 29th 07 01:41 PM
stacking multiple column data into a single column Chubby Excel Worksheet Functions 1 January 12th 07 07:24 AM


All times are GMT +1. The time now is 01: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"