Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Application.UserName Question

How can I use 2 Application.Username(s) in and If/Then statement?

For example:
If Application.UserName < "Bob Jones" Or Application.UserName < "Mike
Smith" Then

Any help would be greatly appreciated.

Thank You!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Application.UserName Question

Use something like =IF(OR(Application.UserName<"Bob
Jones",Application.UserName<"Mike Smith",[THEN],[ELSE])

Dave
--
Brevity is the soul of wit.


"HROBERTSON" wrote:

How can I use 2 Application.Username(s) in and If/Then statement?

For example:
If Application.UserName < "Bob Jones" Or Application.UserName < "Mike
Smith" Then

Any help would be greatly appreciated.

Thank You!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Application.UserName Question

In VB, you would write as:
If OR(argument1,argument2) Then
however, looks liek you want:
If AND(arg1,arg2)
otherwise, you're basically ignoring your first argument with your second.
Unless you want where username IS those names, in which case it should be =.

"HROBERTSON" wrote:

How can I use 2 Application.Username(s) in and If/Then statement?

For example:
If Application.UserName < "Bob Jones" Or Application.UserName < "Mike
Smith" Then

Any help would be greatly appreciated.

Thank You!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Application.UserName Question

"Sean Timmons" wrote in message

In VB, you would write as:
If OR(argument1,argument2) Then


That is NOT how you would write it in VB. That's formula, not VB, syntax.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)


"Sean Timmons" wrote in message
...
In VB, you would write as:
If OR(argument1,argument2) Then
however, looks liek you want:
If AND(arg1,arg2)
otherwise, you're basically ignoring your first argument with your second.
Unless you want where username IS those names, in which case it should be
=.

"HROBERTSON" wrote:

How can I use 2 Application.Username(s) in and If/Then statement?

For example:
If Application.UserName < "Bob Jones" Or Application.UserName < "Mike
Smith" Then

Any help would be greatly appreciated.

Thank You!



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Application.UserName Question

Ack! what was I thining...

IF arg1 Then
....
else arg2
....
End If

my bad...

"Chip Pearson" wrote:

"Sean Timmons" wrote in message

In VB, you would write as:
If OR(argument1,argument2) Then


That is NOT how you would write it in VB. That's formula, not VB, syntax.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)


"Sean Timmons" wrote in message
...
In VB, you would write as:
If OR(argument1,argument2) Then
however, looks liek you want:
If AND(arg1,arg2)
otherwise, you're basically ignoring your first argument with your second.
Unless you want where username IS those names, in which case it should be
=.

"HROBERTSON" wrote:

How can I use 2 Application.Username(s) in and If/Then statement?

For example:
If Application.UserName < "Bob Jones" Or Application.UserName < "Mike
Smith" Then

Any help would be greatly appreciated.

Thank You!






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Application.UserName Question

Better to use Environ("UserName") and test the login name, they can't change
that.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"HROBERTSON" wrote in message
...
How can I use 2 Application.Username(s) in and If/Then statement?

For example:
If Application.UserName < "Bob Jones" Or Application.UserName < "Mike
Smith" Then

Any help would be greatly appreciated.

Thank You!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possibly a loaded question, but I think mileslit Excel Discussion (Misc queries) 1 September 10th 05 01:18 AM
How do I find and replace a question mark in Excel? Ranpalandil Excel Discussion (Misc queries) 1 September 7th 05 10:20 PM
Newbie With A Question Michael Excel Worksheet Functions 0 July 28th 05 11:50 PM
Anybody Help with previous question Anthony Excel Discussion (Misc queries) 1 July 26th 05 01:26 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM


All times are GMT +1. The time now is 06:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"