Results 1 to 2 of 2
Like Tree10Likes
  • 5 Post By Jon von der Heyden
  • 5 Post By Peter_SSs

How to post your vba code

This is a discussion on How to post your vba code within the Board Announcements forums, part of the Announcements category; Here's an important tip: always indent your code. It makes it a lot easier to analyse and it will increase ...

  1. #1
    MrExcel MVP
    Moderator

    Tracy's new best bud
    Jon von der Heyden's Avatar
    Join Date
    Apr 2004
    Location
    Blackboys, East Sussex, UK
    Posts
    10,564

    Default How to post your vba code

    Here's an important tip: always indent your code. It makes it a lot easier to analyse and it will increase your odds of getting help considerably!

    To insert code into a post:

    1. Copy the code from the VBE

    2. In your post type [code]

    3. Paste your code directly after typing in the code tag

    4. At the end of your code type [/code]

    Example:
    Hi guys

    Please can you help me with this code, it spring a runtime error on line 2. Why?
    [code]
    Public Sub Example()
    Call Err.Raise()
    End Sub
    [/code]
    Result:
    Hi guys

    Please can you help me with this code, it spring a runtime error on line 2. Why?
    Code:
    Public Sub Example()
        Call Err.Raise()
    End Sub
    Or simply use the Code tags button found in the Editor. It is the last icon, the one that looks like a hashtag ("#").
    Simply paste your code in, select it, and then click the Code tags button.
    Last edited by Joe4; May 26th, 2017 at 11:04 AM. Reason: Added code tags verbiage
    JohnS, marc j, dbaruzzini and 2 others like this.

  2. #2
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    34,131

    Default Re: VB HTML Maker

    You can also use the VB HTML Maker.

    It can be downloaded from here or here.

    This free add-in will let you convert your Visual Basic code to an HTML "image" that looks the same way as in the VB Editor, that is, comments appear green, some words (Like Dim, Sub, As, End, etc.) appear blue to identify them. It will also maintain the indent level of the code.

    It was based on the very popular HTML Maker add-in from Colo, and was developed by Juan Pablo González with some extensive collaboration from other MrExcel MVPs (XL-Dennis, Ivan F Moala, Colo, dk, NateO, TsTom to name a few).

    The program will add 4 new controls in two different command bars. One, the Tools menu of the VBE main bar, and two, to the right click popup menu of the code pane window. These four new controls are: "Convert selected code as HTML", " Convert current procedure as HTML", "Convert selected code as BB Code" and "Convert current procedure as BB Code". It will convert a selected portion of the code or the entire module if no selection has been made.
    Last edited by Peter_SSs; Dec 2nd, 2015 at 11:53 PM.
    Hope this helps, good luck.
    Peter
    Excel 2010 (mainly), 2016 (not Office 365), 2013, 2007, 2003 - Windows 10, 7
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the VBHTML Maker
    - Read: Forum Rules & Forum Use Guidelines

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com