Actually, the code does work, but I am thinking you are not as familiar with
VBA coding as your original posting may have suggested. Here are the steps
you can take to see the computer's name... From any worksheet, right click
the tab at the bottom of the worksheet and select View Code. Copy/Paste this
code into the window that appeared when you did this...
Sub SeeComputerName()
MsgBox "My computer's name: " & Environ("ComputerName")
End Sub
Now, go back to your worksheet, press Alt+F8 and select the SeeComputerName
item from the list that appears and click the Run button. Now, since
implementing this basic code cause you problems, I am going to suggest you
read up on creating macros before you continue trying to do more complicated
programming. Check out this link as a starter...
http://www.anthony-vba.kefra.com/index_011.htm
(start with the 3 basic tutorials) and, perhaps, buying a basic Excel VBA
book to read might be helpful also.
Rick