Read a .txt file via URL

blelli

Board Regular
Joined
Jul 21, 2013
Messages
63
Dears,

I'm actually working with the following code to read a .txt file.
Code:
Sub DepAptSID()
'Esta função coleta as saídas disponíveis nos aeroportos


    Dim fn As String, txt As String, delim As String, DepSID() As String, SID As String
    Dim i As Long, ii As Long, iii As Long, n As Long, X, y, ContValores As Integer    
    fn = "C:\Users\bruno\Desktop\FMS ATR\DataBase\SID\" & DepAirport & ".txt"      'My txt file path.
    delim = "|"                                     'Delimiter
    
    temp = CreateObject("Scripting.FileSystemObject").OpenTextFile(fn).ReadAll
    X = Split(temp, vbCrLf)
       
    ContValores = 0
    For i3 = 1 To UBound(X)
        'Define how many times the SID was found
        If InStr(1, X(i), "|" & DepRwySel & "|", 1) > 0 Then
            ContValores = ContValores + 1
        End If
        i = i + 1
    Next i3

But now I stored this txt file online. How can I work it?

Thank you
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Watch MrExcel Video

Forum statistics

Threads
1,109,341
Messages
5,528,147
Members
409,804
Latest member
aceyus_michael

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top