• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Undeclared Variable

Frncis

Member
I have a command to ask a user if they want to set a popup calendar to the new month. However, when I debug i get an error message saying undeclared variable on this line: Range(“F9”).Select , True

Here is the entire code:
Code:
Sub Message()
Dim Msg As String, Ans As Variant
Application.Speech.Speak "Please check the date & year of the meeting dates this month,!!   correct as necessary", SpeakAsync:=True
 Application.Wait (Now + TimeValue("00:00:06"))
Application.Speech.Speak " Do you want to set the Calendar to the new month?  ", SpeakAsync:=True
  Msg = "Do you want to set the Calendar to the new month?"
   Ans = MsgBox(Msg, vbYesNo, "Vocational Services - Reminder " & ActiveSheet.Name)
   Select Case Ans
    Case vbYes

 Range(“F9”).Select , True
End Select
End Sub
I know it is something very simple, but at present, I figure it out.
 
Wrong kind of quotation marks around the "F9". Need to be straight quotes, not slanted quotes. Also, drop the ", True"
 
Wrong kind of quotation marks around the "F9". Need to be straight quotes, not slanted quotes. Also, drop the ", True"
That is what it was. I didn't even notice that. I noticed that I had to remove F9 from Code that allowed the user to choose the correct meeting. Also I had to add this line Case vbNo Range("I23").Select to sub message. It took several attempts before I got the straight quotation marks, for some reason, the system kept putting the slanted ones. Again You have sharp eyes.
 
Back
Top