Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Posting VBA code to Forums

Latest post Tue, Apr 8 2008 8:58 PM by Admin. 5 replies.
  • Wed, Jan 9 2008 6:15 AM

    Posting VBA code to Forums

    Since it came up in another thread,  I went and installed the VBHTMLMaker from here. It seems to work just fine although I'm not wild about some of the code (but my fingers itch when I read almost anyone else's source code, so that's not unusual). A bit more excitement in the colouring department wouldn't go amiss, but that's nitpicking.

    Option Explicit

    Public Function AddDate(interval As String, increment As Long, fromDate As Date) As Date
    ' make DateAdd available to the worksheet
    On Error GoTo Catch
        If UCase(Left(interval, 1)) = "Y" Then
            interval = "yyyy"
        End If
        
        AddDate = DateAdd(interval, increment, fromDate)

    Finally:
        On Error GoTo 0
        Exit Function
        
    Catch:
        Resume Finally

    End Function

    Mike
    • Post Points: 21
  • Wed, Jan 9 2008 6:18 AM In reply to

    Re: Posting VBA code to Forums

    mikewoodhouse:
    A bit more excitement in the colouring department wouldn't go amiss
     

    Oh. The forum software stripped out what colouring was there anyway. Never mind.

    Mike
    • Post Points: 21
  • Wed, Jan 9 2008 2:47 PM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 336
    • Points 5,771
    • MVP

    Re: Posting VBA code to Forums

    Mike

    Thanks for taking the trouble. I will gradually build a faq for these types of post tricks.

    I am also looking into the possibility of giving a solution 'built-in' that will give the nice colours too

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    • Post Points: 5
  • Thu, Jan 10 2008 3:46 PM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 336
    • Points 5,771
    • MVP

    Re: Posting VBA code to Forums

    Mike

    I haven't forgotten you. I tried some options last night but I don't think the code was compatible with the code base of the forum, so I am back to square one. I will persist, because it will be a nice feature for posts with code.

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    Filed under: ,
    • Post Points: 21
  • Tue, Apr 8 2008 8:49 PM In reply to

    • Rick Williams
    • Top 25 Contributor
    • Joined on Wed, Jan 9 2008
    • Melbourne, Australia
    • Posts 17
    • Points 341

    Re: Posting VBA code to Forums

    I notice here (http://excelusergroup.org/forums/t/448.aspx) you posted some nicely formatted VBA code - does this mean you have arrived at good solution for posting VBA code?

    Rick Idea
    Melbourne, Australia

    • Post Points: 21
  • Tue, Apr 8 2008 8:58 PM In reply to

    • Admin
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Posts 63
    • Points 262

    Re: Posting VBA code to Forums

    Filed under: ,
    • Post Points: 5
Page 1 of 1 (6 items) | RSS
Copyright Excel User Group and the relevant contributors, 2008. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.