I'm trying to reference the date value in a specific cell on my worksheet to use in my VBA code. But I can't seem to get it to work. Here is what I'm using to pull the data from that cell:
Dim WorkDay As String
Set WorkDay = Sheets("Sheet1").Range("G1")
Then I want to use that date value in a line of code that sends an email from excel vba. I want to put that value in the textbody portion of the email. Here is the line of code for that:
.TextBody = "As Of " & WorkDay
What am I doing wrong? It's not pulling the value. I'm getting a compile error "Object Required".