LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 November 9 2018

duke-of-bytes
Member

excel pop up message

hello
i have an excel worksheet named Transit time who has integers as it counts days.
i want to have a pop up window in excel with a message like " you still have 7 days" or anything else if the transit time is less than 7 days per example , but i also want it to do two things :
- Color the cells who are less than 7 days
- Show the cells number in the message box

for now i have been able to set a small macro with "you still have 7 days" - changing the color should be straightforward but i have something wrong in my writing ( BX is the column in excel)

please tell me what is wrong if possible .. and how to add the cells number ?!

Private Sub Workbook_Open()
    If BX <= 7 Then
        MsgBox "Adjustment is Below the Total"
        End If
For Each cell In BX
If cell.Value <= 7 Then
cell.Interior.ColorIndex = 3
cell.Font.ColorIndex = 2
cell.Font.Bold = True
End If
Next
End Sub

Offline

Board footer