+ Reply to Thread
Results 1 to 3 of 3

Trying to reference a cell in another workbook as part of a formula in VBA

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    36

    Trying to reference a cell in another workbook as part of a formula in VBA

    Hi all. I'm trying to reference another cell from another workbook within a formula in VBA.

    What I'm starting out with is

    Please Login or Register  to view this content.
    That part works just fine. It takes the value four columns from the left of the active cell and subtracts 2% from it. What I want to do is replace the "-2%" part with a reference to a cell in another workbook which will already be open so that it subtracts that value instead of the 2%. What I've tried are:

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    Neither of those seem to work. The specific cell in the workbook I want to reference isn't important (it could be Q1, A1, B3, Z54, whatever) as is the ability to reference a cell of my choice.

    Any help would be greatly appreciated!
    Last edited by DPWM; 04-17-2013 at 06:21 PM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Trying to reference a cell in another workbook as part of a formula in VBA

    Hi,

    Please Login or Register  to view this content.
    where "Example1.xlsm" is the name of the "other" workbook, the cell used is located in the 1st sheet E3.

    Please mark this thread as SOLVED if this answer solves this problem.

    Regards
    Last edited by tehneXus; 04-17-2013 at 04:48 PM.

  3. #3
    Registered User
    Join Date
    04-17-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Trying to reference a cell in another workbook as part of a formula in VBA

    It worked perfectly! Thanks!

+ 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