Results 1 to 6 of 6

How to shorten path in formulas?

Threaded View

frankt68 How to shorten path in... 02-21-2022, 07:20 AM
6StringJazzer Re: How to shorten path in... 02-21-2022, 08:30 AM
mjr veverka Re: How to shorten path in... 02-21-2022, 10:30 AM
Marc L Re: How to shorten path in... 02-21-2022, 11:51 AM
frankt68 Re: How to shorten path in... 02-22-2022, 05:28 AM
6StringJazzer Re: How to shorten path in... 02-22-2022, 10:29 AM
  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Celje, Slovenia
    MS-Off Ver
    2016, 365
    Posts
    29

    How to shorten path in formulas?

    Hi!

    I have to insert a several formulas (Index - match) on the sheet, which finds the data in another workbook, like the one in the example below:

    Range("B2").Select
        ActiveCell.FormulaR1C1 = _
            "=INDEX('C:\Users\MyName\Documents\work\public tender - items\Public tender 2021\Additional\[Items-public tender JN004837-2021-repeated.xlsm]Items JN 1. part'!C1:C8,MATCH(RC8,'C:\Users\MyName\Documents\work\public tender - items\Public tender 2021\Additional\[Items-public tender JN004837-2021-repeated.xlsm]Items JN 1. part'!C8,0),2)"
    .

    It works fine, except that the path to another workbook is rather long, so I'd like to shorten it.

    I'd like to do something like:
    dim strFile as string
    strFile = "C:\Users\MyName\Documents\work\public tender - items\Public tender 2021\Additional\[Items-public tender JN004837-2021-repeated.xlsm]Items JN 1. part"
    but this isn't working correctly because it keeps opening a file dialog box and asking to update values for
    strFile & Items JN 1. part
    What is the right way to do it?

    I'm using Excel for Microsoft 365 for small businesses.
    Last edited by frankt68; 02-22-2022 at 05:29 AM. Reason: Solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to shorten COUNTIF formulas (without using VBA)
    By janmorris in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-24-2021, 12:29 PM
  2. [SOLVED] How to shorten up folder pathway with this workbook.path
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2018, 07:35 PM
  3. Shorten File Path To Access Workbook
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2010, 11:26 AM
  4. linking path and formulas
    By dvb_24 in forum Excel General
    Replies: 0
    Last Post: 07-22-2009, 07:11 AM
  5. Path in formulas
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2006, 01:25 PM
  6. [SOLVED] Shorten Formulas
    By MichelleExcelBeginner in forum Excel General
    Replies: 4
    Last Post: 09-29-2005, 03:05 PM
  7. How to shorten formulas??
    By dwest100 in forum Excel General
    Replies: 4
    Last Post: 09-29-2005, 06:05 AM

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