View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
ward376 ward376 is offline
external usenet poster
 
Posts: 360
Default VBA Project to the Specific Computer

Just thinking - you should use the logic that if your username and
computername are correct, run your code, rather than if both your
username and computername aren't correct, then don't run your code.

Private Sub Workbook_Open()

If Environ("username") = "shahzadz" And _
Environ("computername") = "medhihi0138" _
Then
'do your stuff
Else
Exit Sub
End If

End Sub

Cliff Edwards