+ Reply to Thread
Results 1 to 4 of 4

Adding a message box based on a value

Hybrid View

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    Fort Myers, Florida
    MS-Off Ver
    Excel 2017
    Posts
    29

    Adding a message box based on a value

    Hello,
    I need a little help. I want a message box to appear only if the Value in Range("H1") is greater than 10. I would like the VBMessageBox style to be VBOKONLY and VBEXCLAMATION. Here is my VBA Code I already put together.

    Sub HCHB_JAX()
    '
    ' HCHB_JAX Macro
    '
    
        Sheets("Network Details").Select
        ActiveSheet.PivotTables("PivotTable1").PivotFields("BranchID").ClearAllFilters
        ActiveSheet.PivotTables("PivotTable1").PivotFields("BranchID").CurrentPage = _
            "JAX"
        Sheets("Network Details").Select
        ActiveSheet.PivotTables("PivotTable3").PivotFields("Network").ClearAllFilters
        ActiveSheet.PivotTables("PivotTable3").PivotFields("Network").CurrentPage = _
            "JAX"
        Columns("F:F").Select
        Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
        Range("I19").Select
    
       
        
    End Sub
    I would like the code to be at the end. Thanks for your help

  2. #2
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Adding a message box based on a value

    
    Sub valuetest()
    
    If Range("H1").Value > 10 Then
    MsgBox "The value is greater than 10!"
    Else
    End If
    
    End Sub
    Last edited by Cutter; 10-15-2012 at 04:41 PM. Reason: Removed whole post quote

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    Fort Myers, Florida
    MS-Off Ver
    Excel 2017
    Posts
    29

    Re: Adding a message box based on a value

    Thanks you so much Jay, it was exactly what I wanted.

  4. #4
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Adding a message box based on a value

    Quote Originally Posted by akwishestofish View Post
    Thanks you so much Jay, it was exactly what I wanted.
    no problem, you might want to go to your original post > advanced edit > prefix > mark as solved so the mods dont get upset.

+ 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