Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Joel - Data Consolidate Limitation

Good morning,
I have found the following solution of Joel.
Nevertheless, I would not like to overwrite the available values in
"Summary", but add to the already available values. How is the code to be
adapted?
Many thanks for every help.
Volker


Sub consolidate()

Set SumSht = Sheets.Add(after:=Sheets(Sheets.Count))
SumSht.Name = "Summary"

NewRow = 2
NewCol = 2
For Each sht In Sheets
If sht.Name < "Summary" Then

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

For RowCount = 2 To LastRow
HeaderRow = .Range("A" & RowCount).Value
Set c = SumSht.Columns("A").Find(what:=HeaderRow, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
AddRow = NewRow
SumSht.Range("A" & AddRow).Value = HeaderRow
NewRow = NewRow + 1
Else
AddRow = c.Row
End If

For ColCount = 2 To LastCol
HeaderCol = .Cells(1, ColCount).Value
Data = .Cells(RowCount, ColCount).Value

Set c = SumSht.Rows(1).Find(what:=HeaderCol, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
AddCol = NewCol
SumSht.Cells(1, AddCol).Value = HeaderCol
NewCol = NewCol + 1
Else
AddCol = c.Column
End If

SumSht.Cells(AddRow, AddCol).Value = Data
Next ColCount
Next RowCount
End With
End If
Next sht
End Sub


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
Data Consolidate Limitation Len Excel Programming 10 January 29th 10 01:23 PM
Joel - The DBF Solved Bob Barnes Excel Programming 0 November 19th 09 07:13 PM
web page data (question for Joel) Atishoo Excel Programming 0 November 11th 09 01:11 PM
Joel, Need your help fi.or.jp.de Excel Programming 1 October 20th 09 05:32 PM
Data Validation Limitation r wilcox Excel Programming 0 February 8th 06 10:24 PM


All times are GMT +1. The time now is 01:12 PM.

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"