Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Use Cell as Source file


Hi,

I would like to use the name in the C4 in Sheet1 as my source file as
xls file.
I have written a macro but have error. Attached please find the macro.

Anyone can help.

Thanks.


Sub Macro1()

Range("K10").Select
ActiveCell.FormulaR1C1 = "=[Sheet1!C4.xls]LeakFreq!R39C4"

End Sub


--
ccl28
------------------------------------------------------------------------
ccl28's Profile: http://www.excelforum.com/member.php...o&userid=36095
View this thread: http://www.excelforum.com/showthread...hreadid=569812

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 268
Default Use Cell as Source file

Your code does not help a lot, but
If you want to use a value in a cell to refer to a workbook name, you should
read this value into a varable. Something like wOne = Range("C4").value.
You can then refer to the workbook using wOne. You also cannot mix R1C1 and
A1 references, as you are doing.
ActiveCell.Formula = "='[" & wOne "]LeakFreq'!D39"
would give you the workbook referred to in C4

"ccl28" wrote:


Hi,

I would like to use the name in the C4 in Sheet1 as my source file as
xls file.
I have written a macro but have error. Attached please find the macro.

Anyone can help.

Thanks.


Sub Macro1()

Range("K10").Select
ActiveCell.FormulaR1C1 = "=[Sheet1!C4.xls]LeakFreq!R39C4"

End Sub


--
ccl28
------------------------------------------------------------------------
ccl28's Profile: http://www.excelforum.com/member.php...o&userid=36095
View this thread: http://www.excelforum.com/showthread...hreadid=569812


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
delete info from source file w/out changing the destination file TB New Users to Excel 0 May 26th 08 06:26 PM
Retaining cell reference in destination, when sorting source file Mr Reorg Excel Worksheet Functions 3 April 13th 08 05:11 PM
Linked File Calcuation req. source file to be open smcd Excel Discussion (Misc queries) 1 April 19th 06 03:09 AM
Automatic update of links in destination file when source file mo. Brucgil Excel Discussion (Misc queries) 0 December 2nd 04 04:07 PM
"file not found" error message when launching source file Lisa[_9_] Excel Programming 4 April 6th 04 02:54 PM


All times are GMT +1. The time now is 05:07 PM.

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"