Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ALL of your If-Then blocks (the one's where nothing follows the Then on the
same line) MUST have a matching End If statement... every one of them. And, if the If-Then blocks are nested, the End If statements must be located correctly. If you post that part of your code dealing just with the 16 If-Then calls (and if it isn't too long to follow), I'm sure someone here will restructure it for you. Rick "Hamed parhizkar" wrote in message ... I am running an 16 if functions similar to this below: If Range("C28") 0 Then Range("A23:D34").Select ActiveSheet.PageSetup.PrintArea = "$A$23:$D$34" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End If When I try to run it I get an error saying "Block If without End if" My very last function ends with: End If End Sub But if I take the end sub out I get an error that reads" Expected end Sub" ??? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Form Err.Raise error not trapped by entry procedure error handler | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming |