Ok thanks Skip, that looks good, but I wonder wouldnt I get a problem when I repeat the program and the second chart will be no 2 and so on... I mean since the code alignes ChartObject 1?
Heres the code that works:
Sub plotChart()
Dim chartEnd As Long
chartEnd = Me.lstCoords.ListCount
With ThisWorkbook.Sheets("TempData")
.ChartObjects("Diagram 20").Chart.SeriesCollection(1).XValues = .Range(.Cells(1, 1), .Cells(chartEnd, 1))
.ChartObjects("Diagram...
Could anyone help me with this one?
I want to copy a chart from one sheet to another. Now I've got this far on my own but its not woking like i want it to
Private Sub cbtnPrint_Click()
With ThisWorkbook
.Sheets("TempData").ChartObjects("Diagram 20").Chart.ChartArea.Copy...
.... right, but if I showed the doctor all my values and told him about my problem them Im sure he would know whats wrong... that is if he would be a real doctor
anyway I showed the code to others and they knew right away whats wrong with it so the problems solved.
isnt that the same code that i posted? The listbox is still populated after i copy all the values to the worksheet so
chartEnd = Me.lstCoords.ListCount
should generate the same value as
chartEnd = .Cells(.cells.rows.count, 1).end(xlup).row
isn't that right?
its a xy-scatter chart (as you can se by the code). the user only enters the first two columns (x and y) the following columns are counted by the program.
The program is more than 1500 rows so It would take too long to explain it all. The basic thing is that the values are now in the worksheet...
ok, the user adds values to a listbox in the userform where the values are sorted like i want them, then by pressing a "plot"-button the values are copied to a worksheet and from there they are used to plot the chart.
this is why I set chartEnd=listcount
Hi
Im not quite sure what you mean (Im new at this). Its a user form - a multipage to be specific from the xl visual basic editor.
the part when I copy the values from the listbox to a worksheet is already done in the program.
The values were added by additem.
I want the chart to be plotted...
Hello
Ive tried to figure this out but I cant get this to work.
The problem is that I want to plot a chart but the number of values varies depending on how many listbox rows that the user has populated.
This is my code so far, but it doesnt work:
Sub plotChart()
Dim chartEnd As Long...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.