You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Excel VBA
Ho un file di testo di 50 mega (ebben si mi arriva una cosa del
genere...) con i record di tutti i comuni di Italia
Devo filtrarlo per regione Lombardia e scrivo questo codice:
Sub FiltraComuniMilano()
Open "\MILANO.txt" For Output As #1 'file che mi creo con
solo i comuni di Milano
Set fs = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("LOMBARDIA.TXT", 1)
Do While Not ts.AtEndOfStream
rs = ts.readline
s = Split(rs, ";")
If s(1) = "MI"" Then Print #1, rs
Loop
ts.Close
Close (1)
End Sub
Ma non esiste un metodo migliore?
Potrei anche creare da codice un db access e fare una query....oppure?