Hi all, back again with another ask.
I have tried the below code (with a slight mod to try and pull the whole sheet rather than the range) to try and call up a workbook (name changes so need to be able to select from file explorer), copy sheets 1-4 and paste in the original workbook that the macro was run from, at the end. this can be referenced if needed and is called List Creator v2.xlsm - can anyone help out? I can't get it to work.
Cheers
I have tried the below code (with a slight mod to try and pull the whole sheet rather than the range) to try and call up a workbook (name changes so need to be able to select from file explorer), copy sheets 1-4 and paste in the original workbook that the macro was run from, at the end. this can be referenced if needed and is called List Creator v2.xlsm - can anyone help out? I can't get it to work.
Code:
Sub CopySheet()Dim FileFilter As String
Dim FileName As String
Dim SrcWkb As Workbook
FileFilter = "All Excel Files,*.xla;*.xls;*.xlt,All Files, *.*"
FileName = Application.GetOpenFilename(FileFilter)
If FileName = "False" Then Exit Sub
Set SrcWkb = Workbooks.Open(FileName)
SrcWkb.Sheets(1).UsedRange.Copy ThisWorkbook.ActiveSheet.Range("A1")
SrcWkb.Close False
End Sub
Cheers