+ Reply to Thread
Results 1 to 2 of 2

Reference Row in another workbook with integer variable

Hybrid View

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    NY
    MS-Off Ver
    Excel 2013
    Posts
    1

    Reference Row in another workbook with integer variable

    Hi,

    I need to reference a different workbook in a while loop. Each iteration, PopFive increases by 3, as I want to pull the numbers of every third row. How does the syntax of the line go after the " ! "?

    ActiveCell.Formula = _
            "='[Brief Demographics (Modern).s.xlsx]demographics'!Cells(PopFive,10)"
    Thank you!
    Last edited by Leith Ross; 01-28-2014 at 07:11 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Reference Row in another workbook with integer variable

    Hello orange2014,

    Rmember that a Formula is a Text string. All added values must be concatenated within the existing formula.

    This adds the cell address into the formula.
    ActiveCell.Formula = _
            "='[Brief Demographics (Modern).s.xlsx]demographics'!" & Cells(PopFive,10).Address &""""
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. External reference with variable workbook name?
    By KenV in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 02-04-2019, 06:21 PM
  2. How to reference variable worksheets from a different workbook?
    By Spinky in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-24-2013, 04:14 PM
  3. Code to reference variable named workbook?
    By ajava in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2009, 08:22 PM
  4. Formatting a integer variable or something...
    By timbreeding in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-22-2009, 11:22 AM
  5. Making sure variable is an integer?
    By Mooshey in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 02-04-2008, 12:28 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