[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/11/2008 at 09:27AM PDT, ID: 23557765
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

How do I use a timer to run a for loop once every second in VBA?

Asked by biodieselbenz in Microsoft Excel Spreadsheet Software, VB Script

Tags: Microsoft, Excel, 2003, VBA

I am trying to write a section of code in a VBA Excel file that will be dictated by a timed for loop.  I have a series of instruments that record a data point to a CSV once every second.  I would like to import each successive line of data from the CSV into an Excel file in real time.

Below I have included my code so far.  I'm not sure if I am on the right track or not.  How should I adjust my for loop so that the end range of the loop (44614 in the below example) is progressive (the end time of the data acquisition is entirely variable)?  Also, I want this data from the CSV to be imported once every second.  Anyone have any ideas?  Let me know if I need to offer more information.

Thanks,

Trace
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
Dim wb As Workbook, wb_csv As Workbook, ws As Worksheet, ws_csv As Worksheet, rng As Range
Dim sfile As String, irows As Long
 
Set wb = ActiveWorkbook
Set ws = ActiveSheet
 
sfile = "C:\ExcelTest\testfull.csv" ' Get the CSV filename
Set wb_csv = Workbooks.Open(Filename:=sfile)
Set ws_csv = ActiveSheet
 
Dim PauseTime, Start, Finish, TotalTime 'These are not being used yet.
 
For i = 1 To 44614
With ws.Cells(i, 1)
    .Value = ws_csv.Cells(i, 1).Value
    .Offset(0, 1).Value = ws_csv.Cells(i, 2).Value
    .Offset(0, 2).Value = ws_csv.Cells(i, 3).Value
    .Offset(0, 3).Value = ws_csv.Cells(i, 4).Value
    .Offset(0, 4).Value = ws_csv.Cells(i, 5).Value
    .Offset(0, 5).Value = ws_csv.Cells(i, 6).Value
    .Offset(0, 6).Value = ws_csv.Cells(i, 7).Value
    .Offset(0, 7).Value = ws_csv.Cells(i, 8).Value
    .Offset(0, 8).Value = ws_csv.Cells(i, 9).Value
    .Offset(0, 9).Value = ws_csv.Cells(i, 10).Value
    .Offset(0, 10).Value = ws_csv.Cells(i, 11).Value
    .Offset(0, 11).Value = ws_csv.Cells(i, 12).Value
    .Offset(0, 12).Value = ws_csv.Cells(i, 13).Value
    .Offset(0, 13).Value = ws_csv.Cells(i, 14).Value
    .Offset(0, 14).Value = ws_csv.Cells(i, 15).Value
    .Offset(0, 15).Value = ws_csv.Cells(i, 16).Value
    .Offset(0, 16).Value = ws_csv.Cells(i, 17).Value
End With
Next i
 
wb_csv.Close SaveChanges:=False
 
End Sub
[+][-]07/11/08 10:26 AM, ID: 21984289

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/11/08 10:37 AM, ID: 21984382

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/11/08 10:40 AM, ID: 21984412

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/11/08 10:41 AM, ID: 21984422

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/14/08 06:24 AM, ID: 21997782

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/14/08 06:31 AM, ID: 21997844

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, VB Script
Tags: Microsoft, Excel, 2003, VBA
Sign Up Now!
Solution Provided By: purplepomegranite
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07/14/08 06:35 AM, ID: 21997879

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/14/08 06:45 AM, ID: 21997950

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/14/08 06:53 AM, ID: 21998003

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/14/08 07:23 AM, ID: 21998315

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/14/08 07:26 AM, ID: 21998352

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/14/08 07:28 AM, ID: 21998382

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/14/08 07:36 AM, ID: 21998443

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/14/08 07:40 AM, ID: 21998469

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/14/08 07:43 AM, ID: 21998496

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/14/08 07:47 AM, ID: 21998529

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 / EE_QW_2_20070628