automating a chart

  • Thread starter Thread starter ALLDREAMS
  • Start date Start date
A

ALLDREAMS

Hi All,

In DATA! I keep historical prices of my inventory. Items
are listed in Columm A, Date & Price are in Rows. I
recorded a macro to create a chart for one item.
However, I'd like to have a macro to prompt me for the
item and then create the chart. Could you help me with
this?

you help is greatly appreciated!
 
the items in my inventory. I list them horizontally, the
dates and prices for each item go in rows vertically.
 
Hi ALLDreams,

Here is a "non-elegant" solution:


Assume you have items "a", "b" and "c" in your first column (column 1)

1. Select all items (and dates and prices)
2. Create the chart you want
3. Select the entire area and apply autofilter.
4. Use a macro with the following code:

Dim SelectedItem as String
SelectedItem=Inputbox("Enter Item :")
'Error checks and validation
Selection.AutoFilter Field:=1, Criteria1:=SelectedItem


Your chart will automatically update for item you have entered.

Regards
Leni
 
Back
Top