Automated data logging with excel

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Hello,
I am working on a visual basic project which reads values from an
external source and puts those values into an excel worksheet, into
pre-defined cells. These values change once every minute. What I
would like to do is to write a visual basic program which will take
data from sheet 1 and then store it into sheet two. This will happen
once a minute. And so for the first reading, the program will take
the values from sheet one and write them into row 1 of sheet 2. And
for the second reading, it will take the values from sheet one and
write them into row 2 of sheet 2, and so on.
Also, this program will be taking in a lot of data, and so I would
like the sheet to autosave every hour.
Can someone help me out with either of these functions? I have a
lot of programming experience, though not in visual basic. Please
include details.

thanks,
Andy
 
hi
as to the data transfer, try something like this....
Private Sub TransferData()
Dim r1 As Range
Dim r2 As Range
Sheet1.Activate
Set r1 = Cells(65536, 1).End(xlUp)
Set r2 = Sheet2.Cells(65536, 1).End(xlUp).Offset(1, 0)
r2.Value = r1.Value
r2.Offset(0, 1).Value = r1.Offset(0, 1).Value
r2.Offset(0, 2).Value = r1.Offset(0, 2).Value
r2.Offset(0, 3).Value = r1.Offset(0, 3).Value
'add more if needed
End Sub
as to the time of transfer, look up the on time method in vb help or see
this site...
http://www.cpearson.com/excel/ontime.htm
and to the auto save every hour, i'm having trouble with that myself
see this site...
http://www.mvps.org/dmcritchie/excel/datetime.htm

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top