Hey! I'm pretty new to VBA, but I just need to add a code to import the filename of the selected file into A1 of sheet2. Here's what I have currently;
Sub ImportData()
Dim FileLocation As String
FileLocation = Application.GetOpenFilename
If FileLocation = "False" Then
Beep
Exit Sub
End If
Application.ScreenUpdating = False
Set ImportWorkbook = Workbooks.Open(Filename:=FileLocation)
ImportWorkbook.Worksheets(1).Range("A1:Z1000").Copy ThisWorkbook.Worksheets(1).Range("A1")
ImportWorkbook.Close
Application.ScreenUpdating = True
Application.ScreenUpdating = True
Worksheets("Scan sheet").Activate
Worksheets("Scan sheet").Select
Worksheets("Input data").Visible = xlSheetHidden
End Sub
Sub ImportData()
Dim FileLocation As String
FileLocation = Application.GetOpenFilename
If FileLocation = "False" Then
Beep
Exit Sub
End If
Application.ScreenUpdating = False
Set ImportWorkbook = Workbooks.Open(Filename:=FileLocation)
ImportWorkbook.Worksheets(1).Range("A1:Z1000").Copy ThisWorkbook.Worksheets(1).Range("A1")
ImportWorkbook.Close
Application.ScreenUpdating = True
Application.ScreenUpdating = True
Worksheets("Scan sheet").Activate
Worksheets("Scan sheet").Select
Worksheets("Input data").Visible = xlSheetHidden
End Sub