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

Hello,
I am hoping to work out a method to transform a data table into a running
list.
The table has identifiers in column A, and product weights in a dynamic
number of columns to the right. i.e. Cols B-M. I would like to manipulate
the table into a running list of three columns

Col A = Value of ID @ row(i)
Col B = Product name [value of Cols B-M row(1)]
Col C = Value of weight @ row(i)

Col A | Col B | Col C
A2 B1 B2
A3 B1 B3
A4 B1 B4
A2 C1 C2
A3 C1 C3
A4 C1 C4
A2 D1 A2 ... etc.

I was thinking a 2D array might be the correct approach. Would there be a
better solution? And if the Array is the way to go, where would be the best
place to start?

Thanks in advance,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Manipulating Table data


I like moving this type data from one worksheet to another worksheet
like the code below. The variable names should explain what the code
does.


Sub MakeRunning()

Set Srcsht = Sheets("sheet1")
Set DestSht = Sheets("sheet2")

DestRowCount = 1
With Srcsht
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
LastCol = .Cells(1, Columns.Count).End(xlToLeft).Column

For ColCount = 2 To LastCol
ColHeader = .Cells(1, ColCount)
For RowCount = 2 To LastRow
RowHeader = .Range("A" & RowCount)
Data = .Cells(RowCount, ColCount)

With DestSht
Range("A" & DestRowCount) = RowHeader
Range("B" & DestRowCount) = ColHeader
Range("C" & DestRowCount) = Data
DestRowCount = DestRowCount + 1
End With

Next RowCount

Next ColCount

End With

End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=189254

http://www.thecodecage.com/forumz/chat.php

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
Manipulating data Alfredo_CPA Excel Programming 2 June 17th 09 11:37 PM
Manipulating pivot table fields ... randyvolters Excel Discussion (Misc queries) 0 May 21st 09 07:28 PM
Help With Manipulating Data Pat Excel Discussion (Misc queries) 3 November 21st 08 01:41 PM
Manipulating a Pivot table....HELP!!... WhytheQ Excel Programming 4 October 27th 06 05:29 PM
Manipulating Pivot Table Data Fields Jay Charts and Charting in Excel 1 November 1st 05 03:48 AM


All times are GMT +1. The time now is 01:59 AM.

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"