Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tryer
 
Posts: n/a
Default Creating macro to lookup data


I have a large spreadsheet (some 25000 lines) with headings including
make, model & price. I use this as a lookup table to value other
lists.
If I have a list of say 100 items I lookup each item using autofilter
and extract from the data table the number of items, the max. price,
min. price and average. I am looking for a way to do this automatically
by using a macro
I know this is a complicated one, can anyone help?


--
tryer
------------------------------------------------------------------------
tryer's Profile: http://www.excelforum.com/member.php...o&userid=16546
View this thread: http://www.excelforum.com/showthread...hreadid=392501

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

It sounds like a perfect excuse to learn about pivottables (data|pivotable).

To read more about the pivottable stuff, you may want to look at some links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx


A very short course.
Select your range (include only the last row of headers)
Data|pivottable
data|pivottable
follow the wizard until you get to the dialog with the Layout button
hit that layout button.

Drag Itemheader to the row area
drag item to the data area--if it doesn't say Count of, double click on that and
choose Count from the dialog.

drag price to the data area--double click to show Max
drag price (again) to the data area--double click to show min
drag price (again) to the data area--double click to show average

You can actually drag make, model to the row field to see subcategories.
Then finish up the wizard.

Now drag the Data button one cell to the right. Drop it directly on the cell
that says Total.

===
After you've got what you want, save that workbook. Then try experimenting by
rightclicking on everything and dragging those button like objects around the
pivottable.

Spend an hour playing with pivottables and you'll wonder how you did anything
without them.

=====
Another option (not so nice).

Sort your data
apply data|subtotals multiple times (don't replace current subtotals)--but
choose the correct function you want--min/max/average.

tryer wrote:

I have a large spreadsheet (some 25000 lines) with headings including
make, model & price. I use this as a lookup table to value other
lists.
If I have a list of say 100 items I lookup each item using autofilter
and extract from the data table the number of items, the max. price,
min. price and average. I am looking for a way to do this automatically
by using a macro
I know this is a complicated one, can anyone help?

--
tryer
------------------------------------------------------------------------
tryer's Profile: http://www.excelforum.com/member.php...o&userid=16546
View this thread: http://www.excelforum.com/showthread...hreadid=392501


--

Dave Peterson
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
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM
enter data in cell which will start macro to move data to sheet2 Tommy Excel Discussion (Misc queries) 0 May 12th 05 05:00 PM
macro to browse for workbook, pick up data and looping uriel78 Excel Worksheet Functions 1 March 10th 05 12:37 PM
Macro does not run when data refreshed Larry Lehman Excel Discussion (Misc queries) 0 January 16th 05 07:31 PM


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

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"