Compile Error "Only Comments .."

I have an Excel spreadsheet dfor which I have written a large number of interlinked subroutines in VBA.  Recently (after some 10 years or so) I have received "Out of Memory 0" errors for which I split up the longest subroutine.  Now I receive "Compile Error "Only Comments may appear after End Sub, End Function or End Property."  This seems to appear following a SUB Name() statement.  Looking at the available help, I suspected it should relate to the preceeding subroutine.  Unfortunately, the preceeding subroutine is only 3 lines long: (SUB name(); Call Name2; End Sub). When I comment out the sub then the error message appears somewhere else.  Help!!!
Answer
Answer
Probably, a line Sub ... or Function .... has ended up without the corresponding End Sub or End Function (or vice versa). Check carefully.
---
Best wishes, HansV
https://www.eileenslounge.com

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated December 2, 2022 Views 1,579 Applies to: