Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Reconstructing a table

I can pull a table out of a repository that looks like this --

Bill Mike Sarah Jill Tom
Project 1 0 10 0 0 0
Project 2 40 0 0 12 0
Project 3 15 0 0 0 0
Project 4 0 0 5 0 15


I need to create some formulas to switch the table to look like --

Project 1 Mike 10
Project 2 Bill 40
Project 2 Jill 12
Project 3 Bill 15
Project 4 Sarah 5
Project 4 Tom 15

Basically taking the x-axis (people) and moving it over to be a nested under
projects. I can't figure out how to get there if someone could please help.

Ted



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 834
Default Reconstructing a table

Public Sub ProcessData()
Dim i As Long, j As Long
Dim LastRow As Long
Dim LastCol As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
For i = LastRow To 2 Step -1

For j = LastCol To 2 Step -1

If .Cells(i, j).Value2 < 0 Then

.Rows(i + 1).Insert
.Cells(i, "A").Copy Cells(i + 1, "A")
.Cells(1, j).Copy .Cells(i + 1, "B")
.Cells(i, j).Copy .Cells(i + 1, "C")
End If
Next j

.Rows(i).Delete
Next i

.Rows(1).Delete
End With
End Sub


--

HTH

Bob

"Ted Metro" wrote in message
...
I can pull a table out of a repository that looks like this --

Bill Mike Sarah Jill Tom
Project 1 0 10 0 0 0
Project 2 40 0 0 12 0
Project 3 15 0 0 0 0
Project 4 0 0 5 0 15


I need to create some formulas to switch the table to look like --

Project 1 Mike 10
Project 2 Bill 40
Project 2 Jill 12
Project 3 Bill 15
Project 4 Sarah 5
Project 4 Tom 15

Basically taking the x-axis (people) and moving it over to be a nested
under
projects. I can't figure out how to get there if someone could please
help.

Ted





  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Reconstructing a table

It couldn't have worked better or more easily. Thank you so much Bob, and
have a great weekend!!

"Bob Phillips" wrote:

Public Sub ProcessData()
Dim i As Long, j As Long
Dim LastRow As Long
Dim LastCol As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
For i = LastRow To 2 Step -1

For j = LastCol To 2 Step -1

If .Cells(i, j).Value2 < 0 Then

.Rows(i + 1).Insert
.Cells(i, "A").Copy Cells(i + 1, "A")
.Cells(1, j).Copy .Cells(i + 1, "B")
.Cells(i, j).Copy .Cells(i + 1, "C")
End If
Next j

.Rows(i).Delete
Next i

.Rows(1).Delete
End With
End Sub


--

HTH

Bob

"Ted Metro" wrote in message
...
I can pull a table out of a repository that looks like this --

Bill Mike Sarah Jill Tom
Project 1 0 10 0 0 0
Project 2 40 0 0 12 0
Project 3 15 0 0 0 0
Project 4 0 0 5 0 15


I need to create some formulas to switch the table to look like --

Project 1 Mike 10
Project 2 Bill 40
Project 2 Jill 12
Project 3 Bill 15
Project 4 Sarah 5
Project 4 Tom 15

Basically taking the x-axis (people) and moving it over to be a nested
under
projects. I can't figure out how to get there if someone could please
help.

Ted





.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default Reconstructing a table

Excel 2007 PivotTable
No code, no formulas
http://www.mediafire.com/file/u2mxmwjnwmy/03_12_10.xlsx
Pdf preview:
http://www.mediafire.com/file/4m5elewbz5i/03_12_10.pdf
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 834
Default Reconstructing a table

No pivot either, the original cross-tab report is not pivotable, he needs to
deconstruct it if he wants to pivot it, just as he was asking.

--

HTH

Bob

"Herbert Seidenberg" wrote in message
...
Excel 2007 PivotTable
No code, no formulas
http://www.mediafire.com/file/u2mxmwjnwmy/03_12_10.xlsx
Pdf preview:
http://www.mediafire.com/file/4m5elewbz5i/03_12_10.pdf



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
Pivit table- cell on spread sheet referencing pivot table field David M Charts and Charting in Excel 2 August 18th 07 07:46 PM
entry removed from source table remains in pivot table pull down EL in Melb. Excel Worksheet Functions 1 September 6th 06 07:59 AM
Insert rows in linked table that are added to secondary table Ida LaValley Excel Discussion (Misc queries) 2 August 21st 06 10:52 PM
Excel Pivot Table Plugin? (crosstab to data table) HoMoon115 Excel Discussion (Misc queries) 0 February 22nd 06 08:20 PM
PIVOT TABLE - Summary Table into a Databasae Table. sansk_23 Excel Worksheet Functions 4 May 9th 05 07:45 AM


All times are GMT +1. The time now is 11:55 PM.

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"