Consulting

Results 1 to 5 of 5

Thread: Need Help with the Easist Question Ever

  1. #1
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    2
    Location

    Need Help with the Easist Question Ever

    How do I put two commands on one line in VBA? I thought it was a semicolon, but that is not working - I am getting a syntax error.

    Instead of:
    Array(0) = "smith"
    Array(1) = "jones"

    I want them both on one line:
    Array(0) = "smith"; Array(1) = "jones"

    Seems like it should be so simple but I can't find an answer.

    Thanks!

  2. #2
    VBAX Tutor
    Joined
    Jan 2008
    Posts
    266
    Location
    i just need to know..

    why would you need that?
    whats the problem with having it on two lines?

  3. #3
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    2
    Location
    It makes the code long and harder to read.

  4. #4
    VBAX Tutor
    Joined
    Jan 2008
    Posts
    266
    Location
    so you wnat the code to be long and hard to read? ;-)

    never tried it myself because i cant see the point of it but : seems to do the job according to google

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It is a colon, not semi-colon
    ____________________________________________
    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

Posting Permissions

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