Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default import from txt file

'EC DA CICSEA
Sub FLUSSI()
Workbooks("TABL0664.XLS").Activate
Sheets("L0664").Select

' Range("A3:O10000").Select
' Selection.ClearContents

'Aggiungi ' sotto
Range("a3").Select
Do Until ActiveCell = ""
ActiveCell.Offset(1, 0).Select
Loop
'Fine attacca sotto


Range("A3").Select
Close #1

Dim riga As String
Dim cont As Integer
Dim var_IMPP As String
Dim VAR_DATAP As String
Dim VAR_PARTP As String
Dim OPENfile As String

cont = 3

OPENfile = "E:\EPF\L0664AREA_132.EPF "

Open OPENfile For Input As #1

While Not EOF(1)

Line Input #1, riga

If Len(Trim(riga)) 0 Then



If InStr(Mid(riga, 2, 24), "SPORTELLO :") 0 Then
var_SPORT = Trim(Mid(riga, 15, 5))

If Not EOF(1) Then

Line Input #1, riga
Line Input #1, riga
End If
If InStr(Mid(riga, 2, 24), "PARTITA N.:") 0 Then
VAR_PARTP = Trim(Mid(riga, 22, 8))
var_NOMIN = Trim(Mid(riga, 32, 30))
End If

Line Input #1, riga
Line Input #1, riga
Line Input #1, riga
Line Input #1, riga

If InStr(Mid(riga, 4, 1), "/") 0 Then
var_CARIC = Trim(Mid(riga, 2, 10))
var_NUMEF = Trim(Mid(riga, 19, 10))
VAR_IMP = Trim(Mid(riga, 36, 14))
var_SCAD = Trim(Mid(riga, 53, 10))
var_BNL = Trim(Mid(riga, 67, 5))
var_CORR = Trim(Mid(riga, 79, 5))
var_DEB = Trim(Mid(riga, 94, 30))


End If



Foglio1.Range("A" & Trim(Str(cont))).Value = VAR_PARTP
Foglio1.Range("B" & Trim(Str(cont))).Value = var_SPORT
Foglio1.Range("C" & Trim(Str(cont))).Value = var_NOMIN
Foglio1.Range("D" & Trim(Str(cont))).Value = var_CARIC
Foglio1.Range("E" & Trim(Str(cont))).Value = var_NUMEF
Foglio1.Range("F" & Trim(Str(cont))).Value = VAR_IMP
Foglio1.Range("G" & Trim(Str(cont))).Value = var_SCAD
Foglio1.Range("H" & Trim(Str(cont))).Value = var_BNL
Foglio1.Range("I" & Trim(Str(cont))).Value = var_CORR
Foglio1.Range("J" & Trim(Str(cont))).Value = var_DEB

cont = cont + 1

End If
End If
Wend
Close #1
'Call ORDINA
'Call DUPLICATI
'Call ORDINA2
Range("A3").Select

MsgBox ("ELEBORAZIONE TERMINATA!")
End Sub



Here is a txt file:
http://www.gssitaly.com/l0664.zip

i want from this from the macro:
http://www.gssitaly.com/tabtext.zip

but i have this:
http://www.gssitaly.com/tab_no_good.zip

difficult to go on next rekord in txt file ...ARG!!!!!!!!!!!

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I import text file of cash flow to excel file then use formula Bumpa Excel Discussion (Misc queries) 2 May 28th 10 04:22 PM
import file so that it is a actual csv file, no excel cell version broncoburt New Users to Excel 1 November 21st 09 09:09 PM
Would Like to Automate Batch File Creation and Text FIle Import socrtwo Excel Discussion (Misc queries) 2 August 18th 06 03:54 PM
open file dialog-select file-import worksheet Divinedar Excel Programming 1 January 16th 04 07:13 PM
Get External Data, Import Text File, File name problem Scott Riddle Excel Programming 1 July 11th 03 05:40 PM


All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"