+ Reply to Thread
Results 1 to 7 of 7

VBA msgbox syntax & breaks between boxes

  1. #1
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    VBA msgbox syntax & breaks between boxes

    Heya y'all.

    2 questions about msgbox's.

    1 - While returning a msgbox, I seem to be unable to find the proper fashion of returning text, an integer or variable, and then more text. I can set the integer first with
    msgbox(x) & "text"
    Can't seem to get text, integer, then text.

    2 - While returning multiple msgbox's, is it possible to make changes on the worksheet after each box? I realize this is in the middle of code which is running, so not sure if that's conceivable or not.

    Thanks again guys & gals.

    mew!
    Last edited by mewingkitty; 02-18-2009 at 11:01 PM.
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: VBA msgbox syntax & breaks between boxes

    You are returning all string. Type conversion is being done for you.
    Please Login or Register  to view this content.
    returns "test1test"

    2=Yes.

  3. #3
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: VBA msgbox syntax & breaks between boxes

    You are returning all string. Type conversion is being done for you.

    Code:
    debug.print "test" & msgbox("test") & "test"
    returns "test1test"
    In my messagebox? No it doesn't...It just returns "test" once in the msgbox.

    And I see I've done the classic move of asking if something is possible. Having been informed that it indeed can be done, how would one go about achieving a solution to my 2nd question?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: VBA msgbox syntax & breaks between boxes

    The debug display the string in the immediate window which is under the view menu

    I suspect you should be using a userform by the sound of things but see if this link helps

    http://spreadsheetpage.com/index.php...elected_range/

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA msgbox syntax & breaks between boxes

    Mew, I'm totally confused. Maybe this?
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: VBA msgbox syntax & breaks between boxes

    lol
    That's amazingly cute, SHG.
    I just need to become more familiar with code as I use it. I was under the impression that I needed a ( immedietly after the MSGBOX command, hence my issues with text after that.

    Learned a helluva lot from this site with everyones help, and still learning more.

    Always appreciated!

    I'm going through the link you sent, VBA Noob, I think I can work with this.

    and

    mew!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA msgbox syntax & breaks between boxes

    Mew, see also http://www.excelforum.com/excel-prog...-mismatch.html

    And mark us up as solved ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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