Create macro to calculate data range for a running chart

  • Thread starter Thread starter James Lucero
  • Start date Start date
J

James Lucero

I need to create a running chart that will plot the production rate and
associated dates of four employees. I have seen examples of macros to
automatically resize a data range as new data is entered over time. That
accomplishes a portion of my problem but i also need a macro that will sort
the data by employee last name and then plot on a chart based on that sorted
data.
 
Lots of sort macros out there, on Google for instance
Here is one:
Sub macSort()
Range("A1:A22").Select ' put the range here
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
end sub

This is a great reference:
http://www.mvps.org/dmcritchie/excel/sorting.htm

Turn on the macro recorder and try it a few times yourself.

As for the dynamic range, all the info. you need is right here:
http://www.ozgrid.com/Excel/DynamicRanges.htm
http://www.exceluser.com/explore/dynname1.htm


Regards,
Ryan--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top