+ Reply to Thread
Results 1 to 2 of 2

How to extract full path link or value when there's no full path link in formula bar?

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    How to extract full path link or value when there's no full path link in formula bar?

    Hello,

    I have 2 workbook. For simplicity sake, I call it destination and source workbook.

    What I'm trying to do is simple, copy the formula that's in source workbook of sheet1 at a particular cell to the destination workbook.

    My problem here is that:
    1. Source formula bar has either a formula or a static value.
    2. If it's a formula, there'll be either 1 of these 2:
    2.1 Formula is a full path link i.e. \\network_name\network_folder\....\[workbook_name.xlsx]SheetName'!$A$1 <----This is what I desired
    2.2 Formula is a full path link i.e. \\network_name\network_folder\....\[workbook_name.xlsx]SheetName'!$A$1-A100-B200


    My question is, how am I able to check if it's formula or not?

    If it's formula, I'd only want the full path that reference to that cell, in this case \\network_name\network_folder\....\[workbook_name.xlsx]SheetName'!$A$1.
    If it's a static value, then take it as it is.

    currently, I have (code below), but it's pulling the whole formula.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: How to extract full path link or value when there's no full path link in formula bar?

    The formula property will return the contents of the formula bar, even if it is not a formula. But if the cell contains an actual formula, and not just a string that looks like a formula, the HasFormula property will be True.

    So, unless I misunderstand what you actually have and actually want, try something like this
    Please Login or Register  to view this content.
    Just as an aside, your variable

    srcShtName

    seems more like a string than a worksheet, like it should be

    Worksheets(srcShtName).Range..... instead.

    Better practice is to identify your variables and objects by how you name them - here's a link to a set of pages that cover that topic. Though not explicitly stated there, that is often termed "Hungarian Notation"

    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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. Extract full name from path and open it (or not)
    By Remphan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2016, 03:36 AM
  2. Extract the part of path from a link
    By Ravi.xcel in forum Excel General
    Replies: 10
    Last Post: 03-17-2015, 07:34 AM
  3. Remove full addin(.xla) path from formula bar
    By komalmarkan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-12-2013, 11:37 AM
  4. Full path of an Excel external link
    By Avillo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2010, 04:22 PM
  5. Replies: 7
    Last Post: 10-09-2009, 10:10 AM
  6. [SOLVED] Full path possible to be seen?
    By Octavio in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 07-02-2006, 04:00 PM
  7. [SOLVED] extract filename from full path
    By Leung in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2005, 06:05 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