+ Reply to Thread
Results 1 to 6 of 6

Thread: Excel Message Box

  1. #1
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Excel 2010 & 2007
    Posts
    191

    Excel Message Box

    Hi Again,

    I want excel to bring up a message box, that repeats a value in a set cell, for example 'P3', i am familiar with message boxes bringing up text and input options that have been pre-defined, but im unsure on how to get it to display text in P3, mainly as it will change so much, any thoughts please?

    galvinpaddy
    Last edited by galvinpaddy; 11-22-2011 at 10:16 AM.

  2. #2
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,285

    Re: Excel Message Box

    Hi galvinpaddy,

    Put some text in P3 and then run this code:
    Sub DispMsg()
        MsgBox ("This will Display " & Cells(3, "P").Text)
    End Sub
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Excel 2010 & 2007
    Posts
    191

    Re: Excel Message Box

    OK, thanks for that, next would be, where do i fit that code into the following?

    I woul dneed it to go after the 1st msg box, but before the second part of coding.

    Sub Macro6()
    '
    ' Macro6 Macro
    '
    
    '
        Range("G3").Select
        Selection.Copy
        Range("I1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        If Range("M1").Value = "1" Then
        MsgBox "You have already clocked out!!!" & vbNewLine & "Please delete Entry"
    
    
    End If
    
    
         Range("M1").Select
    If Range("M1") > "0" Then
    Range("H3").Select
        Exit Sub
    Thanks in advance.

  4. #4
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,285

    Re: Excel Message Box

    I can't tell what you are trying to do with the second message box to be able to say.

    I think you want to use the single line of:
    MsgBox ("This will Display " & Cells(3, "P").Text)
    in your code only.

    Maybe a better discription of what you are trying to accomplish or a sample workbook would help me understand what you want.
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  5. #5
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Excel 2010 & 2007
    Posts
    191

    Re: Excel Message Box

    thanks very much fella!! that works spot on.
    Apologies for the poor explanation, i have a 7wk old daughter who thinks its fun to scream all night

    Thanks again!!
    galvinpaddy

  6. #6
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Excel 2010 & 2007
    Posts
    191

    Re: Excel Message Box

    please mark as solved
    Thankyou

+ 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.2.0