+ Reply to Thread
Results 1 to 2 of 2

[Windows Environment Variables] Change user variables using VBA

  1. #1
    Forum Contributor
    Join Date
    04-13-2017
    Location
    Buchares
    MS-Off Ver
    2016
    Posts
    117

    Question [Windows Environment Variables] Change user variables using VBA

    Hey guys,

    Do you know any possible way to modify the windows environment variables? What changes should be needed?
    - To add variable with a value
    - To search in the value of a variable for data, if not present to add to the end of the line

    I know that VBA can use variables in order to be easy to detect some locations like : Environ("userdomain") & "\" & Environ("username") etc etc, but i don't know of any possibility of editing

    Note : added picture with the location of the Windows Environment Variables
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: [Windows Environment Variables] Change user variables using VBA

    This thread answers it well...
    https://www.excelforum.com/excel-gen...-variable.html
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Storing variables as string or as variables in array performance
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2017, 08:35 AM
  2. [SOLVED] User Form - Change Captions with Public Variables
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-25-2015, 04:23 PM
  3. [SOLVED] finding an output from 5 variables in an array using exterior input user variables
    By Allsort in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2013, 11:16 AM
  4. Replies: 3
    Last Post: 09-11-2012, 02:03 AM
  5. macro that finds variables in one column and enters values if variables found
    By xln00b in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2010, 08:22 AM
  6. Unzip Code - Works without Variables, Breaks with Variables...
    By AdamParker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2009, 02:35 PM
  7. Access system-environment variables
    By Perry in forum Excel General
    Replies: 3
    Last Post: 03-31-2006, 07:25 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