+ Reply to Thread
Results 1 to 2 of 2

Use Cell as Source file

  1. #1
    Registered User
    Join Date
    07-06-2006
    Posts
    10

    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
    Last edited by ccl28; 08-09-2006 at 06:32 AM.

  2. #2
    kassie
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1