Moderatori: Anthony47, Flash30005
Sub htmltotxt()
Dim myDir As String, myF As String
'
myDir = "C:\Users\UTENTE\Desktop\DA_PC-FACILE\PIPPO_TEMP\" '<<<
myF = Dir(myDir & "*.html")
'
Do While myF <> ""
Name myDir & myF As myDir & Replace(myF, ".html", ".txt")
myF = Dir
Loop
End Sub
Sub htmltotxt()
Dim myDir As String, myF As String
'
Close #1
myDir = "C:\Users\USER\Desktop\PIPPO_TEMP\" '<<<< La Tua dir, completa di "\" finale
myF = Dir(myDir & "*.html")
'
Do While myF <> ""
Cells.Clear
ActiveSheet.UsedRange
With Range("A1").QueryTable
.Connection = "URL;file:///" & myDir & myF
.Refresh BackgroundQuery:=False
End With
Open myDir & Replace(myF, ".html", ".txt") For Output As #1
For i = 1 To ActiveSheet.UsedRange.Rows.Count
Print #1, Cells(i, 1)
Next i
Close #1
'
myF = Dir
Loop
End Sub
Sub UnaTant()
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.andi.it", _
Destination:=Range("$A$1"))
.Name = "www.andi.it"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
myDir = "C:\Users\USER\Desktop\PIPPO_TEMP\" '<<<< La Tua dir, completa di "\" finale
With ActiveSheet.QueryTables.Add(Connection:= _
"HTML;C:\Users\prova\PIPPO\elenco.html", Destination:=Range( _ '<<<<<path del file di testo
"$A$1"))
.Name = "elenco"
With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.mio_sito_di_origine_dati.it", _
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Visitano il forum: Nessuno e 12 ospiti