Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have created an install routine using a Userform that runs code conditional to the Username. However, the procedure is not recognizing the value of the strName variable. ================ Sub cmdNext_Click() Dim strName as String strName = Environ("Username") If strName = "doej" Or strName = "doex" Then GoTo X_Only Else GoTo Y_Only X_Only: ' Code here..... Y_Only: ' Code here... End Sub ================= Any help you can lend would be appreciated. Henry |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Henry, The way you have have written your SUB the Y_Only routine will always exceute. Try this and see if your problem goes away... Sub cmdNext_Click() Dim strName as String strName = Environ("Username") If strName = "doej" Or strName = "doex" Then GoTo X_Only Else GoTo Y_Only End If 'Any other code goes here... Exit Sub X_Only: ' Code here..... Exit Sub Y_Only: ' Code here... Exit Sub End Sub Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=513807 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This worked for me!
Possibly there isn't anyone logged in?? Regards, GS "Henry Stockbridge" wrote: Hi, I have created an install routine using a Userform that runs code conditional to the Username. However, the procedure is not recognizing the value of the strName variable. ================ Sub cmdNext_Click() Dim strName as String strName = Environ("Username") If strName = "doej" Or strName = "doex" Then GoTo X_Only Else GoTo Y_Only X_Only: ' Code here..... Y_Only: ' Code here... End Sub ================= Any help you can lend would be appreciated. Henry |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is the formula to capture username from system into excel she | Excel Discussion (Misc queries) | |||
How to capture Username into specific cells | Excel Worksheet Functions | |||
What is the function for system to capture the username | Excel Discussion (Misc queries) | |||
What is the fucntion or formula to capture username into excel she | Excel Discussion (Misc queries) | |||
Excel screen capture to capture cells and row and column headings | Excel Discussion (Misc queries) |