Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 09-22-2015, 09:22 AM
NoSparks NoSparks is offline Vba with three  click button help Windows 7 64bit Vba with three  click button help Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

If I understand what you want, and I'm not sure I do....
Perhaps something like this ?

Code:
Sub pop_message_Click()  ' notification
    Dim rng As Range
    Dim cel As Range
    Dim lastrow As Long
    Dim Licensee As String
    Dim msg1 As String, msg2 As String, msg3 As String

Application.ScreenUpdating = False

With Sheets("Sheet1")        '<~~ change to suit
    lastrow = .Cells(Rows.Count, "B").End(xlUp).Row
    Set rng = .Range("B2:B" & lastrow)
    msg1 = "THE ROP LINCENCE FOR MR" & vbCrLf & vbCrLf
    msg3 = vbCrLf & "EXPIRE WITHIN NEXT 30 DAYS"
    
    For Each cel In rng
        If cel.Value >= Date And cel.Value <= Date + 30 And cel.Offset(0, 1).Value <> "informed" Then
            Licensee = cel.Offset(0, -1).Value
            msg2 = msg2 & "      " & UCase(Licensee) & vbCrLf
            cel.Interior.ColorIndex = 0
            cel.Offset(0, 1).Value = "informed"
        End If
    Next cel
End With

If Len(msg2) > 0 Then MsgBox msg1 & msg2 & msg3, vbCritical, "Warning"
   
Application.ScreenUpdating = True

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba with three  click button help How to import excel calender data into outlook - with a click of a button levrone Excel 24 10-01-2021 05:33 AM
ActiveX Command Button disappears after click Bengt Word VBA 1 09-18-2013 12:42 PM
Animations on Button Click dvogler PowerPoint 1 03-01-2012 12:46 AM
Word doc bug when closing from userform command button click macro Joe Patrick Word 1 07-05-2011 08:53 PM
Button click event from a noob jsampson Outlook 0 10-12-2010 01:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft