+ Reply to Thread
Results 1 to 2 of 2

Assigning a cell value to a variable - between different workbooks

  1. #1
    Registered User
    Join Date
    01-18-2016
    Location
    Portugal
    MS-Off Ver
    MS Office 2013
    Posts
    1

    Post Assigning a cell value to a variable - between different workbooks

    How, without opening the source workbook, copy the contents of a cell and put it in a variable in the destination workbook?

    Example:

    Please Login or Register  to view this content.
    The result is ='c:\code\[example.xlsx]Sheet1'!R2C1
    and not the value XPTO

    If I assign the reference to a cell directly, it work:

    Please Login or Register  to view this content.
    The result is XPTO

  2. #2
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: Assigning a cell value to a variable - between different workbooks

    Hello...

    if you do:

    Please Login or Register  to view this content.
    The valueX will be a string with the whole path assigned, not the reference.

    Try this way:

    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. Replies: 12
    Last Post: 02-15-2015, 05:41 PM
  2. [SOLVED] Assigning A Cell Address to A Variable, Using A Variable - Error '1003'
    By ch_abs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2014, 01:36 PM
  3. Assigning a cell to a variable
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-16-2013, 11:12 AM
  4. Assigning Value to Variable, and Show Value of that Variable
    By torofish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2010, 05:42 AM
  5. Assigning a variable and pasting variable to last unused column.
    By Ageia in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-20-2008, 05:06 PM
  6. [SOLVED] Assigning a min to a variable
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2006, 11:30 AM
  7. Assigning a variable a value from a Cell in VBA
    By jefflck@comcast.net in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2006, 02:30 PM

Tags for this Thread

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