+ Reply to Thread
Results 1 to 3 of 3

Using Defined Workbooks and Worksheets in a VBA Formula

  1. #1
    Registered User
    Join Date
    09-25-2006
    Location
    North West, UK
    MS-Off Ver
    2010
    Posts
    73

    Using Defined Workbooks and Worksheets in a VBA Formula

    Hello all, I hope this makes sense

    I am trying to write a formula in VBA using ranges on different workbooks and worksheets

    The defined names I have are
    CodeBook (Workbook)
    DataBook (Workbook)
    DataSheet (Worksheet in DataBook)

    DataBook has multiple worksheets in it, but the one i want to use for this formula is the DataSheet one

    So the formula I am trying to do is written in CodeBook, and links to DataBook>DataSheet>D1:D11

    Normally of course I would just put ='[DataBook]DataSheet'!D1:D11 in a formula when i type it directly into a cell, but can not seem to get this working in VBA

    So can anyone please explain how to refer to these referenced workbooks and sheets in a VBA formula

    Thank you

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Using Defined Workbooks and Worksheets in a VBA Formula

    Maybe try something like

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Using Defined Workbooks and Worksheets in a VBA Formula

    possible something like:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ActiveWorkbook.Worksheets.Name - Apllication-defined or object-defined error
    By CLIOWIWI in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-17-2013, 11:19 AM
  2. Application-defined or object-defined error with vba .formula
    By RogerKMiller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2013, 03:37 PM
  3. [SOLVED] solving #Value error on User defined formula reading from different workbooks
    By bagullo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2012, 10:16 AM
  4. [SOLVED]:Opening workbooks and enabling user defined macros to run in those workbooks
    By vbarookie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-05-2012, 12:00 AM
  5. Application-defined or Object-defined error on Formula entry
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2009, 01:33 PM

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