View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
T Tromp T Tromp is offline
external usenet poster
 
Posts: 1
Default Select other workbook to select data in a macro.

Hi everyone,

If got a problem.
I want to select data in an other workbook to copy it to
the workbook the macro is placed on. I recorded the macro
and it workes well.
But the problem is that everytime the macro is started
Excel askes where the file(for retrieving data) is. So
everytime i have to browse and point out the file.

This is the VB code:

ActiveCell.FormulaR1C1 = _
"=[theDataFile.xls]ColumnName!R2C1:R2C3"

I tried many things...
like:

ActiveCell.FormulaR1C1 = _
"=[C:\2003\theDataFile.xls]ColumnName!R2C1:R2C3"

but nothing works...!!
please help...

Thomas Tromp