+ Reply to Thread
Results 1 to 7 of 7

MsgBox to display specified ranges values on active row

Hybrid View

MannStewart MsgBox to display specified... 10-09-2021, 11:26 AM
Logit Re: MsgBox to display... 10-09-2021, 11:32 AM
MannStewart Re: MsgBox to display... 10-09-2021, 01:03 PM
Fluff13 Re: MsgBox to display... 10-09-2021, 11:47 AM
MannStewart Re: MsgBox to display... 10-09-2021, 01:08 PM
Logit Re: MsgBox to display... 10-09-2021, 11:58 AM
Fluff13 Re: MsgBox to display... 10-09-2021, 01:10 PM
  1. #1
    Forum Contributor
    Join Date
    10-08-2019
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    326

    MsgBox to display specified ranges values on active row

    hi

    i'm just trying to get Excel to display a yes/no MsgBox that includes the values of 5 ranges on the active row, but I don't know what is wrong with my line 4 which Excel is highlighting to debug:

    
    Sub msgbox()
    
        Dim Ans As Integer
        Dim Arow As Integer
        Arow = ActiveCell.Row
        Ans = MsgBox("pls check if your input is correct:" & vbNewLine & "" & vbNewLine & "  Today awarded " & Range("B" & thisRow & " of " & ",A" & thisRow & " from " & ",BD" & thisRow & " according to " & ",BE" & thisRow & " by completing " & ",BF" & thisRow).Value, vbYesNo)
        
        If Ans = vbYes Then
         MsgBox " Great! will calculate"
         Activesheet.Calculate
        Else
         MsgBox Prompt:="    revise your input", Title:="  Input Not Processed"
         Exit Sub
        End If
        
    End Sub

    Can anyone please help ?


    cheers

    Stewart
    Last edited by MannStewart; 10-09-2021 at 11:30 AM.

  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,485

    Re: MsgBox to display specified ranges values on active row

    What is "this row" referring to ?

  3. #3
    Forum Contributor
    Join Date
    10-08-2019
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    326

    Re: MsgBox to display specified ranges values on active row

    @Logit

    sorry typo should have been Arow

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,936

    Re: MsgBox to display specified ranges values on active row

    How about
        Ans = MsgBox("pls check if your input is correct:" & vbNewLine & vbNewLine & "  Today awarded " & Range("B" & Arow).Value & " of " & Range("A" & Arow) & " from " & Range("BD" & Arow) & " according to " & Range("BE" & Arow) & " by completing " & Range("BF" & Arow).Value, vbYesNo)

  5. #5
    Forum Contributor
    Join Date
    10-08-2019
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    326

    Re: MsgBox to display specified ranges values on active row

    @Fluff13

    you the guru, many thanks for your help again

    Stewart

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

    Re: MsgBox to display specified ranges values on active row

    Good code Fluff !

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,936

    Re: MsgBox to display specified ranges values on active row

    Glad to help & thanks for the feedback.

+ 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. [SOLVED] Check before exiting SHEET1 if MsgBox is active or not and stop exit if MsgBox is active
    By RIZVI in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-31-2021, 06:56 AM
  2. [SOLVED] Change value and Msgbox display based on two different columns values.
    By thebeastslayer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2020, 10:49 AM
  3. Replies: 4
    Last Post: 05-17-2019, 12:56 PM
  4. [SOLVED] VBA compare sums in ranges and display delta in MsgBox
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-08-2015, 08:37 AM
  5. [SOLVED] VBA compare sums in ranges and display delta in MsgBox
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2015, 05:15 AM
  6. [SOLVED] Display Range of Values with MsgBox
    By akynyemi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2013, 03:40 AM
  7. Replies: 0
    Last Post: 10-08-2012, 05:53 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