hi!
My code aims to import a csv file and make certain modifications, but I keep getting a 'Sub or Function not Defined'-error.
Any ideas why?
My code aims to import a csv file and make certain modifications, but I keep getting a 'Sub or Function not Defined'-error.
Any ideas why?
Code:
Sub allofit()
Dim ws As Worksheet, strFile As String
ActiveWorkbook.Sheets.Add After:=Worksheets(Sheets(2))
Set ActiveSheet = ws
strFile = Application.GetOpenFilename("Text Files (*.csv),*.csv", , "Please select text file...")
With ws.QueryTables.Add(Connection:="TEXT;" & strFile, _
Destination:=ws.Range("A1"))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh
End With
ws.Name = "testing"
End Sub