ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   System Environment Variables (https://www.excelbanter.com/excel-discussion-misc-queries/113240-system-environment-variables.html)

bdickert

System Environment Variables
 
is there a way to use the SET/System Environment Variables in a spreadsheet?
If yes, please explain. If no, just respond with a no.

Thanks in advance.

BD

smw226

System Environment Variables
 
Hi BD

Paste the following code into a Module:

Public Function envr_user(envr_var As String)
envr_user = Environ(envr_var)
End Function

The enter the below in any cell changing the variable as appropriate:
=envr_user("username")

Thanks,

Simon

bdickert wrote:
is there a way to use the SET/System Environment Variables in a spreadsheet?
If yes, please explain. If no, just respond with a no.

Thanks in advance.

BD




All times are GMT +1. The time now is 07:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com