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.
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: