Hello,
I am currently importing a text file into my worksheet to strip out specific data.
The text file is also being used at the same time by a datalogger.
The trouble I run into is its hit and miss whether I crash the datalogger due to the textfile being opened by Excel, or Excel hangs if the Datalogger has control of the file at the moment Excel tries to open it.
Is there a way to grab a snapshot or copy of the text file in question so both programs can avoid colliding at the text file?
My Second question is this.
After Excel imports the textfile, it looks for a specific text string in a specific column, once its found, it grabs data from OTHER cells based on that cell.
*** Solved this with a nudge from Carl..***
So all I have remaining is a to only grab the first 10 lines on the text file, or a way to quickly import the whole file avoiding the datalogger collision.
Any assistance is appreciated.
Cheers
Lwarence[/code]
I am currently importing a text file into my worksheet to strip out specific data.
The text file is also being used at the same time by a datalogger.
The trouble I run into is its hit and miss whether I crash the datalogger due to the textfile being opened by Excel, or Excel hangs if the Datalogger has control of the file at the moment Excel tries to open it.
Is there a way to grab a snapshot or copy of the text file in question so both programs can avoid colliding at the text file?
My Second question is this.
After Excel imports the textfile, it looks for a specific text string in a specific column, once its found, it grabs data from OTHER cells based on that cell.
*** Solved this with a nudge from Carl..***
Code:
Dim c As Range
With Worksheets(1).Range("D4:D6")
Set c = .Find("GPS", LookIn:=xlValues)
If Not c Is Nothing Then
Range("I10:K10").Select
Selection.Copy
Range("M25:O25").Select
ActiveSheet.Paste
Range("A1").Select
Else
Range("I8:K8").Select
Selection.Copy
Range("M25:O25").Select
ActiveSheet.Paste
Range("A1").Select
End If
End With
So all I have remaining is a to only grab the first 10 lines on the text file, or a way to quickly import the whole file avoiding the datalogger collision.
Any assistance is appreciated.
Cheers
Lwarence[/code]