View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul Paul is offline
external usenet poster
 
Posts: 10
Default Macro question: how to copy information from another workbook.

Hi

I need some help with a macro. By today it looks like

Sub Update_List
Workbooks.Open FileName:="c:\data\List.xls"
Sheets("ListNr1").Select
Cells.Celect
Selection.Copy
Windows("Paul.xls").Activate
Sheets("ListNr1").Select
Cells.Select
ActiveSheet.Paste
End Sub

I have made about 20 workbooks with 20 different names. Paul is one of
them, and the macro above is stored in that workbook. I need a macro
that always copy the information to the workbook where the macro is
started. Instead of the line

Windows("Paul.xls").Activate

I can use

ActiveWindows.ActivateNext

but this will cause problem if more than one workbook is active by the
time the macro is started.

I would appreciate if someone could help me with this.

Paul