Consulting

Results 1 to 3 of 3

Thread: Looking for Let/Get generating macro

  1. #1
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    7,142
    Location

    Looking for Let/Get generating macro

    Before I try to re-invent the wheel, does anyone have a macro that will generate the Let/Get statements from the Class variables?

    Taking something like this

    Option Explicit
    
    
    Private m_SomeDouble As Double
    Private m_SomeString As String
    and generating the Property statements like this

    Option Explicit
    
    
    Private m_SomeDouble As Double
    Private m_SomeString As String
    
    
    Public Property Let propSomeDouble(D As Double)
        m_SomeDouble = D
    End Property
    Public Property Get propSomeDouble() As Double
        propSomeDouble = m_SomeDouble
    End Property
    
    
    Public Property Let propSomeString(S As String)
        m_SomeString = S
    End Property
    Public Property Get propSomeString() As String
        propSomeString = m_SomeString
    End Property
    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,228
    Location
    Carlos Quintera's MZ-Tools addin does just that.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    7,142
    Location
    I'll check it out
    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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