Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Have a list of Environ variables?



I'm looking to see if any has a list, or know where I can
get a list of variables that I can use the Environ()
function on. Specifially I'm trying to log a users Domain
when they open the file. I've been able to get the
following variable so far:


User = Environ("USERNAME")
Machine = Environ("COMPUTERName")


Thanks,

-Scott
  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Have a list of Environ variables?

Hi Scott,
Sub Environ_Check()
Dim r As Long
Dim P As Long
r = 1
Do
Cells(r, 1) = r
Cells(r, 2) = Environ$(r)

P = InStr(1, Cells(r, 2), "=")
Cells(r, 3) = Left$(Cells(r, 2), P - 1)

' 'or the following with Excel 2000
' Cells(r, 3) = Split(Cells(r, 2), "=")(0)
r = r + 1
Loop Until Len(Environ$(r)) = 0
Columns("A:B").AutoFit
[A1].Select
End Sub


--

John

johnf202 at hotmail dot com


"Scott Warren" wrote in message
...


I'm looking to see if any has a list, or know where I can
get a list of variables that I can use the Environ()
function on. Specifially I'm trying to log a users Domain
when they open the file. I've been able to get the
following variable so far:


User = Environ("USERNAME")
Machine = Environ("COMPUTERName")


Thanks,

-Scott



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Have a list of Environ variables?

I don't believe there is a standard set across all windows OS, but you can
see yours with

Sub ListEnviron()
On Error Resume Next
rw = 1
For i = 1 To 100
If Environ(i) < "" Then
Cells(rw, 1) = Environ(i)
rw = rw + 1
End If
Next
Cells(rw + 1, 1) = rw
End Sub

I had

USERDOMAIN

--
Regards,
Tom Ogilvy

"Scott Warren" wrote in message
...


I'm looking to see if any has a list, or know where I can
get a list of variables that I can use the Environ()
function on. Specifially I'm trying to log a users Domain
when they open the file. I've been able to get the
following variable so far:


User = Environ("USERNAME")
Machine = Environ("COMPUTERName")


Thanks,

-Scott



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to match up variables to a common list and confirm DebKnight56 Excel Worksheet Functions 12 July 26th 07 09:40 PM
Including Environ Username in Cell swieduwi Excel Worksheet Functions 9 March 30th 06 04:43 PM
Transfer a list of info dependent upon variables Cody Excel Discussion (Misc queries) 0 November 27th 05 06:58 AM
Select one variable from a list of variables by clicking one cell Curt Excel Discussion (Misc queries) 2 July 21st 05 01:44 AM
List variables in worksheet RB Smissaert Excel Programming 4 August 26th 03 12:37 AM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"