![]()
Please Login or Register to view this content.
this macro currently only runs if ali opens the file I want to run it if Tom or Micheal or John opened it and if anyone else did then do nothing , how can I adapt this macro to do that .. anyhelp
![]()
Please Login or Register to view this content.
this macro currently only runs if ali opens the file I want to run it if Tom or Micheal or John opened it and if anyone else did then do nothing , how can I adapt this macro to do that .. anyhelp
Last edited by VBA Noob; 12-24-2006 at 01:50 PM.
Hi,Originally Posted by khalid79m
amend
If ActiveCell.Value = "ali" Then
to
If ActiveCell.Value = "ali" or ActiveCell.Value = "tom" or ActiveCell.Value = "michael" or ActiveCell.Value = "john" Then
also, as previously advised,
If LCase(Range("A10").Value) = "ali" then
use the lowercase for testing, probably as
If LCase(ActiveCell.Value) = "ali" then
hth
---
Last edited by Bryan Hessey; 12-24-2006 at 02:31 PM.
Si fractum non sit, noli id reficere.
also, as previously advised, amend
ActiveCell.Value = Application.UserName
to lowercase for testing purposes
I dont understand what you mean, all the usernames will be in lowercase anyway as I will set them on each users PC alongside their staff number ie
markhepper0145648
Yes it was amended, I didn't hit the correct line to Lowercase.Originally Posted by khalid79m
the reason for lowercase? - your question was " if Tom or Micheal or John " - and they're not lowercase.
It's something that gets overlooked, it may be simple here to use login names and say that you are always sure of the lowercase, but your question proves that wrong.
As mudraker suggested, use the lowercase, it's good practice and you'll spend less time with hassles when it really counts.
hth
---
also in response to my initial question re if statement
is there an easier way to do it as i need to run the macro for 20 different people out of about 700 who will access the file , could i just do seperate if statement for each one or can you word wrap the script some how ?
20? - I didn't read that into your post. I saw 3 additional people, for which the answer was given.Originally Posted by khalid79m
For a list, something like
should work for you.![]()
Please Login or Register to view this content.
---
added, for the 'wrap' the Help on wrap shows how to wrap in a cell, with a wrap in that instruction.
---
Last edited by Bryan Hessey; 12-24-2006 at 03:04 PM.
hi the last code you gave doesnt seem to work
Hi, yes, at 7:00am it looks different.Originally Posted by khalid79m
tryyou can remove the msgbox line after testing![]()
Please Login or Register to view this content.
amended to include john
---
Last edited by Bryan Hessey; 12-24-2006 at 05:25 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks