Results 1 to 7 of 7

problem with syntax on simple Class declarations and Sub declarations

Threaded View

  1. #1
    Registered User
    Join Date
    09-25-2011
    Location
    Rhode Island, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Unhappy problem with syntax on simple Class declarations and Sub declarations

    I have been having a hard time figuring out the correct syntax to type in an Excel VBA program. When I type these sort of commands into Excel VBA all text is Red as if there are problems with my usage.

    I find a lot of the following type of syntax on the web but can not figure out how to make the same functionality work in Excel. I have written quite a bit of other macros in Excel, but the commands like "GET", "RETURN", "NEW" provide functionality I want to use and can't seem to figure out... Is there a web site that would help with translation that anyone knows about? Is this a VB versus VBA vs .NET problem?

    Private _name As String = "Jeeves"
    Public Property Name() As String
     Get
    Return _name
    End Get
    Set(ByVal value As String)
    _name = value
    End Set
    End Property
    or also...

    Public Class GPS
    or also...

    Public Sub As New (ByVal Degrees As Integer, ByVal Minutes As Integer, ByVal seconds As Double, ByVal Direction As CardinalDirection)
    I know these could be posted almost as separate questions but rather than flood the board with questions I hoped someone could point me in a general direction. I feel like I am missing something fundamental with the language. I have never used "New", "Public", "Private" declarations.

    I have attached an example of a Class module that I am having a hard time getting the "Red" to stop being "red". I don't expect someone to fix everything, but any help would be appreciated.

    Thanks a bunch.
    Rick
    Attached Files Attached Files
    Last edited by ocean_engineer; 09-25-2011 at 02:22 PM. Reason: violated rules

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1