Text file import and cell query questions

LwarenceD

New Member
Joined
Nov 24, 2005
Messages
29
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..***
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]
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I would try making a separate copy of the file for Excel to work on - either manually or with a macro using FileCopy.

You could also try importing your lines with this, although I guess you would get the same problem :-
http://www.mrexcel.com/board2/viewtopic.php?p=776905#776905

Instead of :-
Do While Seek(FileNum) <= LOF(FileNum) .... Loop
use something like :-
For x = 1 To 10 ....... Next
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top