+ Reply to Thread
Results 1 to 8 of 8

How to apply a popup MsgBox for all rows

  1. #1
    Registered User
    Join Date
    01-21-2015
    Location
    Belgium
    MS-Off Ver
    Office 2013
    Posts
    25

    How to apply a popup MsgBox for all rows

    Hello,

    I have a vba that shows me a popup MsgBox when the value in "Q3" > 0 the popup shows me a text and the value of this cell

    [Private Sub Worksheet_Calculate()
    If [Q3] > 0 Then MsgBox "Text " & Range("Q3")
    End Sub]

    I want this to happen for range "Q3:Q200"

    Can someone help me out.

    Thx

  2. #2
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: How to apply a popup MsgBox for all rows

    The range Q3:Q200 contains 198 cells - if all the cells have values > 0 do you really want 198 MsgBoxes?

    If so...
    Please Login or Register  to view this content.
    Last edited by mgs73; 01-28-2015 at 06:36 AM.

  3. #3
    Registered User
    Join Date
    01-21-2015
    Location
    Belgium
    MS-Off Ver
    Office 2013
    Posts
    25

    Re: How to apply a popup MsgBox for all rows

    No I don't.

    Thx for pointing out my mistake.
    These cells can only contain numerical values, so if there are more cells with value > 0 I would like to see the sum of all these cells in 1 MsgBoxs preliminary with "text"

    I hope you understand my explanation.

  4. #4
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: How to apply a popup MsgBox for all rows

    How about this (I've assumed the numbers to be integers - if not change 'Long' to 'Double')

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-21-2015
    Location
    Belgium
    MS-Off Ver
    Office 2013
    Posts
    25

    Re: How to apply a popup MsgBox for all rows

    perfect it works great.
    Just it gives a small difference in result because my "Q" column is limited to 2 decimal places.

    Just 1 small question, is it normal that i have to click 3 times on ok (in the MsgBox) before it closes?

  6. #6
    Registered User
    Join Date
    01-21-2015
    Location
    Belgium
    MS-Off Ver
    Office 2013
    Posts
    25

    Re: How to apply a popup MsgBox for all rows

    I sloved the clicking problem by using the VBA with at CommandButton

    And by doing this i changed my workbook a little bit what brings me with the next question

    I made this command button for every sheet.

    Can I link these buttons when if you click on 1 CommandButton, 1 MsgBox will appaer with the sum of all the values of Column "Q" of all the sheets in this workbook together?

  7. #7
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: How to apply a popup MsgBox for all rows

    Instead of using Worksheet_Calculate event in your sheet, you could use the Workbook_SheetCalculate event in the workbook object:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-21-2015
    Location
    Belgium
    MS-Off Ver
    Office 2013
    Posts
    25

    Re: How to apply a popup MsgBox for all rows

    Thx for your help mgs73

    Everything is working now.

+ 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] MsgBox Popup To Enter Value
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2013, 08:19 AM
  2. Excel 2007 : msgbox popup in vba
    By ag23035 in forum Excel General
    Replies: 2
    Last Post: 03-07-2011, 08:37 PM
  3. how to popup msgbox once exit ?
    By vumian in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2006, 10:04 AM
  4. How to popup msgbox in this
    By vumian in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-31-2006, 12:58 PM
  5. Popup MsgBox
    By jackle in forum Excel General
    Replies: 1
    Last Post: 02-12-2006, 11:50 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