Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code in my auto_open. I keep getting an error msg
stateing "Else without an IF". Can someone tell me where my coding is going wrong? What I'm doing is checking to see if a persons name is at f1 and if false, then run macro 2 asking for it. But, if no name is ther and it's after the trial date, then shut down immediately. Thanks Sub Auto_Open() 'This first "IF" statement checks for a recorded name at f1 If Worksheets("data").Range("f1") < 1 Then Call Macro2 ElseIf Now Worksheets("data").Range("f10") Then 'This shuts down the program after 10/31/03 Application.DisplayAlerts = False ThisWorkbook.Save Application.Quit End If End Sub Rem Call Macro2 Rem End Sub Sub Macro2() ' ' Macro2 Macro ' Macro recorded 7/30/2003 by DLS 'Sub GetInput() Dim MyInput 'This line of code is optional MyInput = InputBox("Enter Company Name") Range("data!f2").Value = MyInput MyInput = InputBox("Enter your Name") Range("data!f1").Value = MyInput msgbox ("Hello ") & MyInput End Sub DLS *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
if statements | Excel Worksheet Functions | |||
If Statements | Excel Discussion (Misc queries) | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
IF and MAX statements | Excel Worksheet Functions | |||
if statements help | New Users to Excel |