vba error

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA error

VBA error

resolvedResolved · High Priority · Version 2003

John has attended:
Excel VBA Intro Intermediate course

VBA error

I received the error"Compile error:Expected:Identifier" when try to create a procedure. The error appeared when hit enter after typing Sub.

Compile error:Expected:Identifier

Hi John

When creating a procedure you have to give the procedure a name.

By pressing Enter immediately after writing Sub causes the "Compile error:Expected:Identifier" error because you haven't named the Procedure.

If you enter

Sub MacroName

and then press enter.

You will create a procedure with no problems unless you already have a procedure in the module with the same name

Carlos

RE: Compile error:Expected:Identifier

Thanks Carlos. I was doing VBA for the first time after few attempts I have already figured it. Many thanks for answering this question

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

No Zeros

Want all the zeros in your worksheet to appear blank? Choose Tools/Options, Click on the View Tab, Deselect the Zero Values Option, Click OK.
Easy wasn't it? But be aware that these cells are not actually blank, they still contain the value zero. This is important because certain functions (ie AVERAGE) make a distinction between blank cells and those with a zero value.

View all Excel hints and tips


Server loaded in 0.08 secs.