+ Reply to Thread
Results 1 to 3 of 3

Cells to link to "current workbook"

  1. #1
    David P.
    Guest

    Cells to link to "current workbook"

    I have a spreadsheet that contains pricing that is calculated by referencing
    cells in various other workbooks saved under customer names (not at the same
    time).

    I need to create a macro that will allow me to easily link my pricing
    workbook to my customer workbooks. Any macro that I have tried to create to
    accomplish that limits itself to the workbook I pointed it to while creating
    it.

    Is there a way to write the code that can be flexible to reference any
    workbook and not specifically the workbook it originally referenced?

    Hope that made sense. I'm stuck. I've tried all kinds of tricks. Thank you.
    --
    David P.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning David

    Try saving your macro as an add-in, and don't reference it to a particular workbook by name, but use the ActiveWorkbook instruction, which will just use the file you are working on.

    HTH

    DominicB

  3. #3
    paul
    Guest

    RE: Cells to link to "current workbook"

    you dont need a macro,in the cell you want the link to exist in type =and
    then click in the cell in the workbook you want to link to.ie the workbook
    that you want to link to has to be open at the time you create the
    link,unless you know the name of the workbook and the cell reference you want
    to link to you just type ='C:\Documents and Settings\John Smith\My
    Documents\[book1.xls]Sheet1'!$O$4 or similar
    --
    paul
    remove nospam for email addy!



    "David P." wrote:

    > I have a spreadsheet that contains pricing that is calculated by referencing
    > cells in various other workbooks saved under customer names (not at the same
    > time).
    >
    > I need to create a macro that will allow me to easily link my pricing
    > workbook to my customer workbooks. Any macro that I have tried to create to
    > accomplish that limits itself to the workbook I pointed it to while creating
    > it.
    >
    > Is there a way to write the code that can be flexible to reference any
    > workbook and not specifically the workbook it originally referenced?
    >
    > Hope that made sense. I'm stuck. I've tried all kinds of tricks. Thank you.
    > --
    > David P.


+ 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