View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Problem when opening 2nd spreadsheet with vba while in another!

Generally, with two workbooks open, you need to specify which one to do
something with. There are several ways to do so. The following 2
commands
(4 lines in Book1.xls) do the same thing.

Workbooks("Book2.xls").Sheets("Sheet1").Range("A2: B3").Copy _
Destination:=Workbooks("Book1.xls").Sheets("Sheet1 ").Range("A5")
Workbooks("Book2.xls").Sheets("Sheet1").Range("A2: B3").Copy _
Destination:=ThisWorkbook.Sheets("Sheet1").Range(" A5")
Application.CutCopyMode = False

Hth,
Merjet