Hi all!
I'm super new to macros/vba and am working on a project for work that requires me to import csvs from a folder into a specific workbook. Each csv will need to go into a new sheet of this same workbook. I read around on the site to get the code I need to pull this off, but for some reason I'm getting a syntax error and my file path is highlighting red - even though its a valid file path (I've checked about 10 trillion times just to be extra sure). I've read several troubleshooting articles, but I'm at a loss and have no idea what I'm doing wrong.
Can someone PLEASE help and point me in the right direction?
Here's what I'm using:
Any help or direction would be SO appreciated!
I'm super new to macros/vba and am working on a project for work that requires me to import csvs from a folder into a specific workbook. Each csv will need to go into a new sheet of this same workbook. I read around on the site to get the code I need to pull this off, but for some reason I'm getting a syntax error and my file path is highlighting red - even though its a valid file path (I've checked about 10 trillion times just to be extra sure). I've read several troubleshooting articles, but I'm at a loss and have no idea what I'm doing wrong.
Can someone PLEASE help and point me in the right direction?
Here's what I'm using:
HTML:
Sub ImportCSVs()
Dim fPath As String
Dim fCSV As String
Dim wbCSV As Workbook
Dim wbMST As Workbook
Set wbMST = ThisWorkbook
fPath = “C:\Users\morga\Desktop\dashboard\”
Application.ScreenUpdating = False
Application.DisplayAlerts = False
fCSV = Dir(fPath & “ * .csv”)
On Error Resume Next
Do While
Len(fCSV) > 0
Set wbCSV = Workbooks.Open(fPath & fCSV)
ActiveSheet.Move After:=wbMST.Sheets(wbMST.Sheets.Count)
fCSV = Dir
Loop
Set wbCSV = Nothing
Application.ScreenUpdating = True
End Sub
Any help or direction would be SO appreciated!