LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
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






 
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
Max if statements instereo911 via OfficeKB.com Excel Discussion (Misc queries) 5 October 29th 08 05:32 PM
if statements SB777 Excel Worksheet Functions 3 April 13th 07 06:42 PM
If, Then Statements RS Excel Worksheet Functions 0 November 30th 06 05:38 PM
If, Then Statements Dave F Excel Worksheet Functions 0 November 30th 06 05:33 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM


All times are GMT +1. The time now is 08:11 PM.

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"