Hello, I'm following the "Automated Text Import in Excel with File Selection - The Easy Way - VBA" tutorial. I've gone through and completed the example with the various components and am now trying to build it to my specific purpose. I generated a .csv in another program and would like to import this, skipping the first (header) row. The tutorial shows a way to do this which works for me with the example .txt file, but when I import my .csv file (after changing the delimiter to comma) the header row is still included (see screenshot included). Can anyone tell me where I'm going wrong?
Sub Import_File()
Dim FileToOpen As Variant
Dim fileFilterPattern As String
Dim wsMaster As Worksheet
Dim wbTextImport As Workbook
Application.ScreenUpdating = False
fileFilterPattern = ".csv Files (*.csv), *.csv"
FileToOpen = Application.GetOpenFilename(fileFilterPattern)
If FileToOpen = False Then
MsgBox "No file selected."
Else
Workbooks.OpenText _
Filename:=FileToOpen, _
StartRow:=2, _
DataType:=xlDelimited, _
Comma:=True
Set wbTextImport = ActiveWorkbook
Set wsMaster = ThisWorkbook.Worksheets("Raw Data")
wbTextImport.Worksheets(1).Range("A1").CurrentRegion.Copy wsMaster.Range("A3")
wbTextImport.Close False
End If
Application.ScreenUpdating = True
End Sub