Hi,
Im needing help on macro which imports a worksheet(s) into the open workbook's specific worksheet(s).
We have a shared drive with the files in one folder I want to import from. When I run the macro i want them to drop into specific worksheet(s), i.e refreshing the workbook
So far i have this:
Sub GetFile()
' This macro will import a file into this workbook
Sheets("Menu").Select
PathName = Range("D2").Value
Filename = Range("D3").Value
TabName = Range("D4").Value
ControlFile = ActiveWorkbook.Name
Workbooks.Open Filename:=PathName & Filename
ActiveSheet.Name = TabName
Sheets(TabName).Copy after:=Workbooks(ControlFile).Sheets(1)
Windows(Filename).Activate
ActiveWorkbook.Close SaveChanges:=False
Windows(ControlFile).Activate
Sheets("Menu").Select
Range("D8").Select
ActiveCell.Value = "Completed"
Range("D9").Select
End Sub
But it just creates new worksheet with the name in "D4" not copy into Tabname "D4".
Any help would be really appreciated, im just starting out on macro's.
Bookmarks