View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Problem With Auto Open

Hi Graham
change the line
If LCase(ThisWorkbook.Name) = "READYRECKONER.xls" Then

to
If UCase(ThisWorkbook.Name) = "READYRECKONER.XLS" Then


--
Regards
Frank Kabel
Frankfurt, Germany


Graham wrote:
Hi,
I have the following code running with Auto Open, but the
procedure does not seem to be working. It looks as if it's
skipping straight to the user form display at the end. I
guess there's something wrong with my "if" statement, but
I don't know what it is. Any help gratefully received!

Thanks
Graham

If LCase(ThisWorkbook.Name) = "READYRECKONER.xls" Then

Sheets("READY RECKONER").Visible = True
Sheets("READY RECKONER").Select
Sheets("READY RECKONER").Protect
DrawingObjects:=False, Contents:=False, Scenarios:=False

Range("CONTRACT_LENGTH").Select
Selection.ClearContents
Range("NO_OF_TEMPS").Select
Selection.ClearContents
Range("DAILY_HOURS").Select
Selection.ClearContents
Range("PAY_RATE").Select
Selection.ClearContents
Range("ENTER_MARGIN").Select
Selection.ClearContents
Range("ENTER_MARKUP").Select
Selection.ClearContents
Range("ENTER_FIXED").Select
Selection.ClearContents

Sheets("READY RECKONER").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
Sheets("READY RECKONER").Visible = False

Sheets("ROLLING PENNY").Visible = True
Sheets("ROLLING PENNY").Select
Sheets("READY RECKONER").Protect
DrawingObjects:=False, Contents:=False, Scenarios:=False


Range("Q12").Select
ActiveCell.FormulaR1C1 = "1"
Range("S12").Select
ActiveCell.FormulaR1C1 = "1"

Range("A1").Select

Sheets("READY RECKONER").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
Sheets("ROLLING PENNY").Visible = False

End If

' Display the Ready Reckoner Input Form

ReadyReckoner.Show