+ Reply to Thread
Results 1 to 6 of 6

Embedding environmental variable into a formula

  1. #1
    Registered User
    Join Date
    07-02-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    5

    Embedding environmental variable into a formula

    Hey everyone,

    I have a document that is used among multiple people that references other Excel files stored locally on their machine. As of right now I need to create different versions for everyone as I have to specify the entire filepath. Naturally we all have different paths as indicated by the username (C:\Users\username\desktop). Here is my formula as is stands currently:
    Please Login or Register  to view this content.
    I am needing the v-cmeyer to be changed automatically depending on the user who opens it. I have created a module which displays the Windows environmental variable of username but cannot seem to incorporate it into the existing formula. Was wondering if this is even possible or do I need to approach it differently? Any help would be greatly appreciated. Thanks.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Where does the formula display the name?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-02-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Embedding environmental variable into a formula

    In the filepath is where the formula is supposed to be. Where is says v-cmeyer I need the =Username() variable I created. Sorry for the confusion.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Can you post the code and example formula that uses it?

  5. #5
    Registered User
    Join Date
    07-02-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Embedding environmental variable into a formula

    Here is the ENV variable code, which works by itself:
    Please Login or Register  to view this content.
    Here is where I am trying to apply it.
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Embedding environmental variable into a formula

    hi dachadster13, it looks it should be sort of that then:

    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. embedding a formula
    By stephen1000 in forum Excel General
    Replies: 5
    Last Post: 03-10-2009, 08:26 AM
  2. embedding tab name variable into a formula?
    By keilamym in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2009, 02:02 PM
  3. Embedding a formula
    By sixfivebeastman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2005, 03:48 PM
  4. [SOLVED] Pass environmental variables?
    By Gunkie in forum Excel General
    Replies: 2
    Last Post: 03-07-2005, 07:06 PM
  5. [SOLVED] Environmental Commands?
    By Gunkie in forum Excel General
    Replies: 2
    Last Post: 03-03-2005, 12:06 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