Formula to show PC name, or IP, or personal windows ID

N

nkoichev

Is it posible some formula to show PC name, or IP, or personal windows
ID?
...or some computer characteristic that is different on every computer.
 
B

Bob Phillips

environ("ComputerName")

environ("UserName")

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
P

paul

the cell or info functions may reveal something you can use to identify a
certain user/computer.I have asked users to input or choose a name to
identify themselves/computer/printer
--
paul
remove nospam for email addy!



environ("ComputerName")

environ("UserName")

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
N

nkoichev

There's no such a formulas in excel like "=environ("ComputerName")

=environ("UserName")" !?

The result is "#NAME?"
 
S

Steve Yandl

It's part of VBA.

Create a macro like

Sub GetUserName()
MsgBox Environ("UserName")
End Sub

run and see what you get. Instead of creating a subroutine, you could write
a custom function and the variables would be available the same as standard
Excel functions.

Steve
 
B

Bob Phillips

If you want it in a worksheet, create a UDF

Function attr(choice as string)
select case lower(choice)
case "computer": attr = Environ("Computername")
case "user": attr = Environ("UserName"
end select
End Function

and use like

=attr("User")

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
D

David McRitchie

Belongs in VBA
missed the other replies, but there are still a couple of items
that were not mentioned.

install the following user defined function, if you need instructions see
http://www.mvps.org/dmcritchie/excel/getstarted.htm

function udf_ComputerName()
udf_computername = environ("ComputerName")
end function

=udf()
=personal.xls!udf()

More information on
http://www.mvps.org/dmcritchie/excel/property.htm

You can test in Intermediate (Ctrl+G) window of the VBE

msgbox environ("computername")
 
Top