Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
automated plotting in excel.. need help
Can someone help me understand why I can't use the folling code to autoplot in a file?
Range(Cells(2, 1), Cells(variable, 2)).Select
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets(sheetname).Range(Cells(2,_ 1), Cells(variable, 2)), PlotBy:=xlColumns
My code runs right thru the first Range selection without a problem but when I want to designate source data, it doesn't like it.
I need to do it this way because the files I am plotting are of variable rows. I use a counter to count down until there is no data in a row then the variable is the row number that all the plots need to go to.
I tried concatenating the variable number with the other method for range selection
Range("A2:B"&variable) type of thing but that doesn't work either.
Any ideas on what might be the problem or how I might use a variable in the range selection process???
0 · ·