A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Consolidating data



 
 
Thread Tools Display Modes
  #1  
Old June 5th, 2010, 03:01 PM posted to microsoft.public.excel.misc
Don Guillett[_2_]
external usenet poster
 
Posts: 607
Default Consolidating data

Sent OP this

Option Explicit
Sub SAS_MakeTable()
Dim lr As Long
Dim c As Range
Dim mm As Double
Dim mr As Long
Dim mc As Double

Application.ScreenUpdating = False

lr = Cells(Rows.Count, "b").End(xlUp).Row
Range("f3:r" & lr).ClearContents

Range("B2:B" & lr).AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("F2"), Unique:=True

For Each c In Range("b4:b" & lr)
mm = Month(c.Offset(, 1))
mr = Columns(6).Find(What:=c, LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext).Row
'MsgBox mr
mc = Rows(2).Find(What:=mm, LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext).Column
'MsgBox mc
Cells(mr, mc) = Cells(mr, mc) + c.Offset(, 2)
Next c
Application.ScreenUpdating = True
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message news:...
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"BDT" wrote in message
...
Hi,

I need to consolidate some lines of data in a 19K line spreadsheet and
then
change its basic format.

I have 3 columns of data: ID# | date | volume

My problem is that while the data is mostly monthly, there are some
months
with two entries and I need to consolidate them into a single monthly
value.
I don't care which of the dates is used as long as the month and year are
correct. That's the 'consolidate' part.

Then I need to convert the 19,000 row spreadsheet to a big grid with the
meters listed in the left row and the month/year at the top of each
column
with the appropriate volumes in the body of the table. This is the
'format'
part and I suspect that I can use Access to do this, but I thought I
would
ask for input here, too.

thanks



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.