"Environ" : This Function return various Environment details ,all the Strings associated with an operating systems environment variables
This code is useful if you need to obtain info about your users operating system. The code loops through all the Environment variables available, and returns the name of the variable, and the string value associated with it. The Environ function is used to obtain things like the Windows Username, Userprofile, System root, etc
To Find User Name & Computer Name :
Sub envn()
MsgBox Environ("Username")
MsgBox Environ("Computername")
End Sub
To Find system Info :
Sub env()
Dim i As Long
Sheets.Add
For i = 1 To 56
Cells(i, 1).Value = Environ(i)
Next i
Columns("A").AutoFit
End Sub
This code is useful if you need to obtain info about your users operating system. The code loops through all the Environment variables available, and returns the name of the variable, and the string value associated with it. The Environ function is used to obtain things like the Windows Username, Userprofile, System root, etc
To Find User Name & Computer Name :
Sub envn()
MsgBox Environ("Username")
MsgBox Environ("Computername")
End Sub
To Find system Info :
Sub env()
Dim i As Long
Sheets.Add
For i = 1 To 56
Cells(i, 1).Value = Environ(i)
Next i
Columns("A").AutoFit
End Sub
No comments:
Post a Comment