View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tommo_blade tommo_blade is offline
external usenet poster
 
Posts: 31
Default HELP = VBA Code To Import Worksheets Into A WorkBook

it's this piece of code that I do not understand:

Worksheets.Copy after:=Sheets(Sheets.Count)
bk.Close savechanges:=False

at the top of my code I have set the following, this sets bk to be the
workbook I have opened:

Folder = "F:\My Documents\Fantasy Football\XLS_Emails\"
FName = Dir(Folder & "*.xls")
Do While FName < ""
With ThisWorkbook
Set bk = Workbooks.Open(Filename:=Folder & FName)
For y = 1 To bk.Sheets.Count

< more code


so how does the copy work, what is copying what to where - I want to
copy the sheet from the open workbook to a new sheet in my master
workbook

Worksheets.Copy after:=Sheets(Sheets.Count)
bk.Close savechanges:=False


sorry for being dumb..