Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Select other workbook to select data in a macro.

Sub test()
Workbooks.Open Filename:= _
"Path & Servant"
'---------
Workbooks("Master").Activate
'copy procedures
ActiveCell.FormulaR1C1 = _
"=[Servant]ColumnName!R2C1:R2C3"
'---------
Workbooks("Servant").Close
End Sub
"T Tromp" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select other workbook to select data in a macro.

Thanks very much,
thomas



-----Original Message-----
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

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
macro to sum select columns in all workseets within a workbook Jodie Excel Worksheet Functions 2 October 27th 09 07:46 PM
Macro to select cells without a certain value and select a menu it Guy[_2_] Excel Worksheet Functions 9 January 2nd 09 05:21 PM
select workbook macro Nigel Excel Discussion (Misc queries) 3 May 16th 05 01:45 PM
import select data from another workbook schoeller Excel Worksheet Functions 0 March 31st 05 03:13 AM


All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"