+ Reply to Thread
Results 1 to 3 of 3

VBA link reference to an another workbook's cell

  1. #1
    Registered User
    Join Date
    06-25-2018
    Location
    Sri Lanka
    MS-Off Ver
    2016
    Posts
    3

    VBA link reference to an another workbook's cell

    I need to create a macro to get values from another workbook's cell. Like below

    Cells(1,1).value= "='C:\January\[workbookname.xls]Sheet1'!A1"

    but when the next month comes I need to need to change the "January" part to "February" without changing the macro. Ideally, That part should be a variable.

    I tried below code, But it won't work. Any help

    Cells(1,1).value= "='C:\ & Worksheets("Months").Range("A2").Value & \[workbookname.xls]Sheet1'!A1"

    Months sheet contains the names of months.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: VBA link reference to an another workbook's cell

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    06-25-2018
    Location
    Sri Lanka
    MS-Off Ver
    2016
    Posts
    3
    Quote Originally Posted by :) Sixthsense :) View Post
    Please Login or Register  to view this content.
    Thanks.it's working.

+ 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. Cell reference use to link to different workbook.
    By intentionally blank in forum Excel General
    Replies: 13
    Last Post: 12-07-2018, 01:34 PM
  2. Link to a workbook using a cell reference
    By PCArmour in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-15-2016, 05:32 PM
  3. Replies: 2
    Last Post: 03-02-2016, 07:05 AM
  4. Reference Cell or Date within formula workbook link
    By GeorgeMustang in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2014, 12:24 PM
  5. External Workbook Link with Dynamic Cell Reference
    By mst3kr in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-24-2014, 10:24 PM
  6. Replies: 0
    Last Post: 09-23-2013, 05:59 PM
  7. Replies: 0
    Last Post: 10-11-2012, 10:48 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