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

vba error

ResolvedVersion 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:

Use the SUBTOTAL function in Excel

You can create subtotals in your spreadsheet using the SUBTOTAL function, which looks like this:

=SUBTOTAL(9,cell:cell)

9 represents the function being used (SUM), followed by the range of cells the function is operating on.

The neat thing about using the Subtotal function is that if you have used it several times in the same column or row, clicking on the AutoSum button at the end of the column or row will make Excel add only the results of cells containing the Subtotal function in that column or row.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.