leatherhen99
New Member
- Joined
- Dec 17, 2019
- Messages
- 27
- Office Version
- 365
- Platform
- Windows
Good Morning,
I have a written quite a bit of code for a few spreadsheets lately, and with all my research, I've found that I can use the immediate window to check things in my code... I'm LOVING that! Unfortunately, no one has addressed this in their posts or videos...so I'd like to see if someone can provide a way to use the immediate window instead of running/stepping thru the macro...
I have the following code... and sometimes the email will have the full subject (quotes and cell reference), and other times, it won't include the cell reference...
Questions:
1. How do I utilize the immediate window with a "?" to confirm the email subject?
2. Is there another way to verify that's easier than running/stepping thru the code?
Thanks to all who comb thru these posts and provide responses! I really appreciate everyone else's posts and answers! I hope someone else can find this post useful, too!
Thanks, H
I have a written quite a bit of code for a few spreadsheets lately, and with all my research, I've found that I can use the immediate window to check things in my code... I'm LOVING that! Unfortunately, no one has addressed this in their posts or videos...so I'd like to see if someone can provide a way to use the immediate window instead of running/stepping thru the macro...
I have the following code... and sometimes the email will have the full subject (quotes and cell reference), and other times, it won't include the cell reference...
VBA Code:
Sub send_to_supervisor()
'select CRT sheet
Sheets("CRT").Select
'Create the email to send to supervisor to review time
Dim emailApplication As Object
Dim emailItem As Object
Dim strbody As String
Dim sT0 As String
Dim rng As String
sT0 = Range("C17").Value
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
strbody = "<body style = font-size:11pt; font-family:Calibri.>" & _
"Hi " & Range("b17").Value & ", <br><br> Please review the <a href=""location"">timesheet</a>" & _
" for final approval.<br><br>" & _
"Thank you,"
On Error Resume Next
With emailItem
.To = sT0
.Subject = "Timesheet Approval " & Range("a2").Value
.display
.HTMLBody = strbody & .HTMLBody
End With
On Error GoTo 0
Set emailItem = Nothing
Set emailApplication = Nothing
ActiveSheet.Shapes("check box 7").OnAction = ""
End Sub
Questions:
1. How do I utilize the immediate window with a "?" to confirm the email subject?
2. Is there another way to verify that's easier than running/stepping thru the code?
Thanks to all who comb thru these posts and provide responses! I really appreciate everyone else's posts and answers! I hope someone else can find this post useful, too!
Thanks, H