LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Reconstructing a table with Arrays

Hi Bythsx-Addagio,

In Excel 2007 I have crated this macro


Sub Adagio()
Dim lastRow As Long
Dim lastCol As Long
Dim loopRow As Long
Dim loopCol As Long
Dim outputRow As Long

lastRow = Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row
lastCol = Cells(1, ActiveSheet.Columns.Count).End(xlToLeft).Column

outputRow = 1
For loopRow = 2 To lastRow
For loopCol = 2 To lastCol
If Not IsEmpty(ActiveSheet.Cells(loopRow, loopCol)) Then
outputRow = outputRow + 1
Sheets("Sheet2").Cells(outputRow, 1) =
ActiveSheet.Cells(loopRow, 1)
Sheets("Sheet2").Cells(outputRow, 2) = ActiveSheet.Cells(1,
loopCol)
Sheets("Sheet2").Cells(outputRow, 3) =
ActiveSheet.Cells(loopRow, loopCol)
End If
Next
Next

End Sub

HTH,

Wouter.
 
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
Reconstructing a table Ted Metro Excel Worksheet Functions 4 March 13th 10 12:27 AM
Finding Duplicate Arrays in a table JohnHB Excel Discussion (Misc queries) 4 July 2nd 09 07:47 PM
Using text to lookup different table arrays in vlookup. stuart Excel Worksheet Functions 2 June 16th 08 05:27 PM
VLookups Across Mulitple Table Arrays Elise148 Excel Discussion (Misc queries) 6 July 17th 07 02:57 AM
arrays and pivot table Carsten Excel Worksheet Functions 1 June 12th 05 09:10 AM


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