W
Wayne
Using Windows XP (OS) and Office 97
I have a cell (Ref: A1) that returns a user name via a
Function module.
I want to produce a module with a function which, when
the workbook is opened the function refers to Cell A1 and
determines if a user is not permitted to use the workbook
or not. Upon this outcome the workbook is either
terminated or allows the user to continue.
I've tried using and "Playing" with the following but
really have no idea how to do it.:-
Private Sub Worksheet_Change(ByVal Target As Range)
'Joe Bloggs - OK to use
'Paul Smith - OK to use
If Intersect(Target, Range("A1"))="Joe Bloggs" Then
exit Sub
If Intersect(Target, Range("A1"))="Paul Smith" Then
exit Sub
Else If Intersect(Target, Range("A1")) <>"Joe Bloggs"
or "Paul Smith" Exit Excel
End If
End Sub
I maybe barking up the wrong tree all together...
If any one has an other tree or is good at sorting messes
out...
Thanks in advance
I have a cell (Ref: A1) that returns a user name via a
Function module.
I want to produce a module with a function which, when
the workbook is opened the function refers to Cell A1 and
determines if a user is not permitted to use the workbook
or not. Upon this outcome the workbook is either
terminated or allows the user to continue.
I've tried using and "Playing" with the following but
really have no idea how to do it.:-
Private Sub Worksheet_Change(ByVal Target As Range)
'Joe Bloggs - OK to use
'Paul Smith - OK to use
If Intersect(Target, Range("A1"))="Joe Bloggs" Then
exit Sub
If Intersect(Target, Range("A1"))="Paul Smith" Then
exit Sub
Else If Intersect(Target, Range("A1")) <>"Joe Bloggs"
or "Paul Smith" Exit Excel
End If
End Sub
I maybe barking up the wrong tree all together...
If any one has an other tree or is good at sorting messes
out...
Thanks in advance