View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default If ..Then statements

I think this is what you mean

If ActiveWorkbook.FullName < "C:\TMR\TMR.xls" Or _
Dir("C:\WINDOWS\system32\unicode.txt") = vbNullString Then
MsgBox "Contact Psyfactor Ltd for Licence", vbOKOnly, "TMR"
Application.ActiveWorkbook.Save
Application.Qui
Else
Sheets("MENU").Select
End If

But you may want to draw up a decison table for the 4 options
FullName < AND Dir = Nul
FullName < AND Dir < Null
FullName = AND Dir = Nul
FullName = AND Dir < Null
to check it out

--

HTH

RP
(remove nothere from the email address if mailing direct)


"phil" wrote in message
...
How does this work exactly - here is my code-hopefully you can see
what I'm trying to do here. This is part of the'open' procedure. Where
would I write myvar code or define myvar?
Thanks for your help

Sheets("MENU").Select

If ActiveWorkbook.FullName = "C:\TMR\TMR.xls" Then

Sheets("MENU").Select
Else
Sheets("End").Select
Range("A1").Select
MsgBox "Contact Psyfactor Ltd for Licence", vbOKOnly, "TMR"
Application.ActiveWorkbook.Save
Application.Quit

End If

If Dir("C:\WINDOWS\system32\unicode.txt") = vbNullString Then
Sheets("End").Select
Range("A1").Select
MsgBox "Contact Psyfactor Ltd for Licence", vbOKOnly, "TMR"
Application.ActiveWorkbook.Save
Application.Quit
End If



End Sub

"Rob van Gelder" wrote:

If MyVar1 = True And MyVar2 = False Then
MsgBox "First Condition Satisified"
Else
MsgBox "Do Something Else"
End If

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"phil" wrote in message
...
If you have 2 conditions (2 IF statements) and both must be met, or we

go
to
the
'else' statement, what is the code for this?
Your help will be appreciated.
--
phil in da uk