- Joined
- Dec 13, 2017
- Messages
- 71
- Reaction score
- 19
I have code that runs when the workbook is activated. However, when I want to choose "yes" to go to that cell, it doesn't go to the cell. It is probably something, very simple that, I am missing. I have tried several things, such as activating the sheet & selecting the cell, & several other things, with no success.
Here is the code, it is located on thisworkbook:
One final Question, is it possible to simplify this code?
Here is the code, it is located on thisworkbook:
Code:
'Greets user.
Dim sGreet As String
If Hour(Time) <= 12 Then
sGreet = "Good morning... it's " & WeekdayName(Weekday(Date)) & ", " & MonthName(Month(Date), False) & " " & Day(Date) & ", " & Year(Date) & " & there are " & CDbl(Application.EoMonth(Date, 0) - Date) & " days left in the month."
'MsgBox "there are " & CDbl(Application.EoMonth(Date, 0) - Date) & " days left."
Else
sGreet = "Good afternoon... it's " & WeekdayName(Weekday(Date)) & ", " & MonthName(Month(Date), False) & " " & Day(Date) & ", " & Year(Date) & " & there are " & CDbl(Application.EoMonth(Date, 0) - Date) & " days left in the month."
End If
Application.Speech.Speak sGreet
Application.Wait (Now + TimeValue("00:00:015"))
'MsgBox sGreet & ".", vbInformation, "Vocational Services"
'Activates a reminder to change the month for the pop up Calendar.
MsgBox " If today is the 1st of the month, or close to the first, change the month for the Popup Calendar. Today is " & Date & " & there are " & CDbl(Application.EoMonth(Date, 0) - Date) & " days left in the month.", vbInformation, _
"Vocational Services Reminder"
Application.Speech.Speak " Do you want to change the month for the Popup Calendar? "
Application.Wait (Now + TimeValue("00:00:07"))
Ans = MsgBox("Do you want to change the month for the Popup Calendar?", vbYesNo, "Vocational Services Reminder")
If MsgBoxResult = vbNo Then
'Sheets(“TOC”).Select
'Range(“A1”).Select
Exit Sub
ElseIf MsgBoxResult = vbYes Then
ThisWorkbook.Sheets("TOC").Activate
ActiveSheet.Range("C58").Select
End If
'Hide sheet tabs
'ActiveWindow.DisplayWorkbookTabs = False
End Sub
Last edited: