×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

indenting of vba code

indenting of vba code

indenting of vba code

(OP)
I notice that vba is good at putting colors into my code to make it more readable.

I vaguely remember that it used to indent for readability but now it doesn't anymore.

This code ends up all left justified
If 3 > 2 Then
MsgBox ([var1])
End If

Why doesn't it indent the middle line?

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: indenting of vba code

In the VBA editor check Tools=>Options, and select "Editor Tab".  I believe there is an "Auto Indent" checkbox on that form.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein

RE: indenting of vba code

Cajun's solution will indent the next line if you have indented a line. So you'll have to indent pretty much yourself. A good - and free - automatic indenter is SmartIndent (http://www.bmsltd.ie/indenter/default.htm)

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: indenting of vba code

(OP)
Awesome. Thanks guys.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources