Hi all,

This is my first post to this forum, but I enjoy seeing the topics discussed. I have a bit of a problem today. I want to create a macro that automatically updates a histogram, but am not the best in VBA and have not been able to utilize anything I have found on the web so far. This is mainly due to the fact that my inputs for the histogram come from a separate sheet than the output. What I want the macro to do is go to a tab, call it Tab X, take values from start range E3 and then go down to the end (the end cell updates so it has to automatically find the end). Then the macro must set the results back onto my histogram tab. The histogram chart must then select all the values from the freq. and bin to repopulate the histogram. Because the amount of cells will change as my freq. and bin grow, I have a problem here as well. Thoughts would be appreciated. The code I have been messing with is below...

Thanks,

NicB.

Sub Update_Histogram()

Application.Run "ATPVBAEN.XLA!Histogram", Sheets("Prices 010105-Current").Select
Range("E3").Select
Range(Selection, Selection.End(xlDown)).Select , ActiveSheet.Range("A1"), , False, False, False, True
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).XValues = "=Histogram!R2C1:R39C1"
ActiveChart.SeriesCollection(1).Values = "=Histogram!R2C2:R39C2"
Windows("Prices 7-1-1992 - Current.xls").SmallScroll Down:=-27
ActiveWindow.Visible = False
Windows("Prices 7-1-1992 - Current.xls").Activate
Range("F4").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("F4").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("F4").Select
Application.CutCopyMode = False
End Sub