Results 1 to 4 of 4

DaysRemaining MsgBox

Threaded View

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    DaysRemaining MsgBox

    Greetings,
    Open enclosed file and run following macro in order to understand what Macro1 is doing.
    Sub Macro1()
    DaysRemaining = Range("AC34") - Date
    Select Case DaysRemaining
        Case Is = 1: MsgBox Prompt:="1 days left."
        Case Is = 2: MsgBox Prompt:="2 days left."
        Case Is = 3: MsgBox Prompt:="3 days left."
        Case Is = 4: MsgBox Prompt:="4 days left."
        Case Is = 5: MsgBox Prompt:="5 days left."
        Case Is = 6: MsgBox Prompt:="6 days left."
        Case Is = 7: MsgBox Prompt:="7 days left."
        Case Is = 8: MsgBox Prompt:="8 days left."
        Case Is = 9: MsgBox Prompt:="9 days left."
        Case Is = 10: MsgBox Prompt:="10 days left."
    End Select
    End Sub
    I want to change above macro to below macro.
    Red line need to be corrected.
    Sub Macro1()
    DaysRemaining = "=MIN(AC2:AC29)" - Date
    Select Case DaysRemaining
        Case Is = 1: MsgBox Prompt:="1 days left."
        Case Is = 2: MsgBox Prompt:="2 days left."
        Case Is = 3: MsgBox Prompt:="3 days left."
        Case Is = 4: MsgBox Prompt:="4 days left."
        Case Is = 5: MsgBox Prompt:="5 days left."
        Case Is = 6: MsgBox Prompt:="6 days left."
        Case Is = 7: MsgBox Prompt:="7 days left."
        Case Is = 8: MsgBox Prompt:="8 days left."
        Case Is = 9: MsgBox Prompt:="9 days left."
        Case Is = 10: MsgBox Prompt:="10 days left."
    End Select
    End Sub
    Best regards.
    Attached Files Attached Files
    Last edited by HerryMarkowitz; 01-22-2014 at 08:49 PM.
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Problem with VBA Editor uses lower case on some lines (ex. msgbox instead of MsgBox)
    By stubbsj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2013, 06:59 PM
  2. MsgBox won't go away
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2008, 04:40 PM
  3. VBA MsgBox
    By burgerboy2k6 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2008, 06:18 PM
  4. MsgBox-center the message on a msgbox
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2007, 06:48 AM
  5. [SOLVED] MsgBox-at the end a msgBox popup
    By CC in forum Excel General
    Replies: 4
    Last Post: 05-05-2006, 12: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