HELP! PCSU 1000 VBA makro and x-y plot

hey guys,

i have a problem with the VBA makro code. i’ve copied the velleman code for getting the data into an excel sheet.
My problem is that i only need one value in the first row (e.g. B4 and C4) and the next in the row below (B5 and B5).
every time i click on the “read data” button. can someone show me the source code?

as i have read, a continously data memory or data copying into an excel sheet is not possible.
i need about 30 values to create an x-y plot.

thanks.

ProjectTeam

It is very easy to reduce the number of data rows.
Reduce the number of loops:

For i = 0 To 99 .Cells(i + 1, 2) = DataBuffer1(i) .Cells(i + 1, 3) = DataBuffer2(i) Next i

I think this will do the job:

For i = 0 To 4 .Cells(i + 1, 2) = DataBuffer1(i) .Cells(i + 1, 3) = DataBuffer2(i) Next i

I know how to reduce the number of rows.
The problem is that the old row is overwritten by the new one.

I need something like:
i = i +1 to swith into the next row below.

Is it important to use the for-loop?

This will put the new data to new rows:

Sub Read_Data() Dim i As Long ReadCh1 DataBuffer1(0) ReadCh2 DataBuffer2(0) With ActiveSheet For i = 0 To 2 .Cells(i + 1, 2) = DataBuffer1(i) .Cells(i + 1, 3) = DataBuffer2(i) Next i For i = 3 To 4 .Cells(i + j + 1, 2) = DataBuffer1(i) .Cells(i + j + 1, 3) = DataBuffer2(i) Next i j = j + 2 End With End Sub
Add to the declarations section:

Dim j As Long

To be sure j = 0 at the startup:

Sub Start() Start_PCSU1000 j = 0 End Sub

thx,
i will try it.

but this means, that i have to declare, e.g. 20 variables, for 20 values in different rows?!
i will contact you again, if this won’t work :wink: