+ Reply to Thread
Results 1 to 4 of 4

Entering variables on Msgbox prompt

  1. #1
    Registered User
    Join Date
    06-09-2004
    Posts
    40

    Entering variables on Msgbox prompt

    Hi,

    I am trying to enter a variable on the prompt of a message box. Could someone help me on this?

    Thanks,

    Variable: Range("Year")
    Prompt: Msgbox "Yada yada yada (variable should go here) yada yada yada"

  2. #2
    evgny
    Guest

    Re: Entering variables on Msgbox prompt

    Hi renegan
    Dim a as variant
    a = Range(???).value
    Msgbox "Yada yada yada " & a & " yada yada"

    Regards
    Yngve


  3. #3
    John
    Guest

    Re: Entering variables on Msgbox prompt

    Assuming the result is a string you could use something like:

    Dim sYear As String

    sYear = Range("Year").Value
    Msgbox "Yada yada yada " & sYear & " yada yada yada"

    Best regards

    John


    "renegan" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    >
    > I am trying to enter a variable on the prompt of a message box. Could
    > someone help me on this?
    >
    > Thanks,
    >
    > Variable: Range("Year")
    > Prompt: Msgbox "Yada yada yada (variable should go here) yada yada
    > yada"
    >
    >
    > --
    > renegan
    > ------------------------------------------------------------------------
    > renegan's Profile:
    > http://www.excelforum.com/member.php...o&userid=10450
    > View this thread: http://www.excelforum.com/showthread...hreadid=498001
    >




  4. #4
    Registered User
    Join Date
    06-09-2004
    Posts
    40
    Thank you both John and evgny. It worked fine.

+ 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