this macro not work correctly

sal21

Board Regular
Joined
Apr 1, 2002
Messages
231
'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!!!!!!!!!!!!
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Egress1

Active Member
Joined
Mar 2, 2003
Messages
420
Hi again Sal,

Isn't this the same thing you wanted on the last workbook? You should be able to incorporate the mods I did for all your workbooks to accomplish just adding imported info to the bottom of your current data.

If you open that macro I changed for you you will see 'COMMENTS in there explaining the changes etc.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,085
Messages
5,599,650
Members
414,325
Latest member
kfg1287

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
Top