+ Reply to Thread
Results 1 to 3 of 3

MsgBox show results from another sheet

  1. #1
    Forum Contributor
    Join Date
    11-20-2009
    Location
    Melbourne
    MS-Off Ver
    Excel 365
    Posts
    263

    MsgBox show results from another sheet

    I have written some VBA to find the Max value in a range and then return the corresponding values relating to that Max value.
    I can then show this in a Msg Box.
    The MsgBox shows the desired results when everything is aligned to the current worksheet.
    However, if I try to initialise the MsgBox on a separate Sheet within the same workbook I cannot do it.
    Could someone look at the code below and advise how I can get the MsgBox to appear please?

    [code]
    Sub NPark2()
    Dim nMax As Long
    Dim MaxiNP As Long
    With Sheets("Max2")
    nMax = Evaluate("=MAX(IF(B:B=""Noble Park"",a:a))")
    MaxiNP = nMax
    Team = Application.VLookup(MaxiNP, Range("A:H"), 2, False)
    Goal = Application.VLookup(MaxiNP, Range("A:H"), 3, False)
    Bhds = Application.VLookup(MaxiNP, Range("A:H"), 4, False)
    Pnts = Application.VLookup(MaxiNP, Range("A:H"), 5, False)
    Yers = Application.VLookup(MaxiNP, Range("A:H"), 6, False)
    Rond = Application.VLookup(MaxiNP, Range("A:H"), 7, False)
    TmVs = Application.VLookup(MaxiNP, Range("A:H"), 8, False)
    MsgBox Worksheets("Max2").Team & Chr(10) & Worksheets("Max2").Goal & "." & Worksheets("Max2").Bhds & "." & Worksheets("Max2").Pnts & Chr(10) & "against " & Worksheets("Max2").TmVs & Chr(10) & "in " & Worksheets("Max2").Yers, vbInformation, "HS in Under 10's"
    End With
    End Sub
    [\code]

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: MsgBox show results from another sheet

    .
    One way includes temporarily writing the data to a range, then referencing that range in your Message Box code.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-20-2009
    Location
    Melbourne
    MS-Off Ver
    Excel 365
    Posts
    263

    Re: MsgBox show results from another sheet

    Thank you very much.
    I'll give this go.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Concatenate filter results and show sheet name, create table
    By moosmahna in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2017, 07:43 AM
  2. Replies: 6
    Last Post: 04-22-2014, 11:32 AM
  3. [SOLVED] Show results from a sheet in a userform
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2014, 12:25 PM
  4. [SOLVED] how to add counter in msgbox to show remain times the message will show vba code
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2013, 06:46 AM
  5. [SOLVED] Only show msgbox once
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2013, 11:25 AM
  6. Show MsgBox if mentioned Sheet does not exist
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2011, 04:30 PM
  7. Msgbox results
    By kistonce in forum Excel General
    Replies: 2
    Last Post: 05-18-2010, 10:34 PM

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