Random Phrase Popup in Excel
I use a pretty large Excel Workbook every day in my job. I thought it might be nice to have a “motivational” phrase show each time the workbook was opened. Something to start the day out on the right foot.
In my workbook I created a worksheet called phrases that simply consist of a motivational phrase on each row. You can have as many of them as you want. I then went into the VBA Editor (Alt+F11) and inserted this little snippet of code into “This Wookbook”. Now each time I open the workbook I get a random phrase off of my phrases worksheet.
Photo courtesy of: tinyfroglet
Private Sub Workbook_Open()
Dim MyValue
With Worksheets(”PHRASES”)
LR = .Cells(.Rows.Count, “A”).End(xlUp).Row
Randomize
MyValue = Int((LR * Rnd) + 1)
MsgBox (.Cells(MyValue, “A”)), vbOKOnly, “Thought of the Day”
End With
End Sub

Leave a Reply