ING Hammer
New Member
- Joined
- Apr 12, 2024
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hello,
I am very new to VBA and trying to find out how to make this work.
So basically I have a Checkmark from D2 to unlimited.
When Checkmark is clicked > Display Message
I have the following code written so far but I don't know how to display my message without having to run the simulation.. I don't know how to pass the function to open my message windows with an if command.
This is my code so far:
Sub CheckBox_Date_stamp() is just when Checkbox gets clicked, Date is going to be passed in the next cell and in the second cell a "yes" or "no" text.
I am sorry if this looks like a mess for you, but like I mentioned I am very new to this (started yesterday). Please be patient with me >.<
I am very new to VBA and trying to find out how to make this work.
So basically I have a Checkmark from D2 to unlimited.
When Checkmark is clicked > Display Message
I have the following code written so far but I don't know how to display my message without having to run the simulation.. I don't know how to pass the function to open my message windows with an if command.
This is my code so far:
Sub CheckBox_Date_stamp() is just when Checkbox gets clicked, Date is going to be passed in the next cell and in the second cell a "yes" or "no" text.
I am sorry if this looks like a mess for you, but like I mentioned I am very new to this (started yesterday). Please be patient with me >.<
Excel Formula:
Sub CheckBox_Date_stamp()
Dim xChk As CheckBox
Set xChk = ActiveSheet.CheckBoxes(Application.Caller)
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
With xChk.TopLeftCell.Offset(, 1)
If xChk.Value = xlOff Then
.Value = ""
Else
.Value = Date
End If
With xChk.TopLeftCell.Offset(, 2)
If xChk.Value = xlOff Then
.Value = "Nein"
Else
.Value = "Ja"
End If
End With
End With
End Sub
Sub Email_From_Excel_Basic()
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
emailItem.to = "Test@test,com"
emailItem.Subject = "Test"
emailItem.Body = "Test Text"
'emailItem.Send
emailItem.Display
Set emailItem = Nothing
Set emailApplication = Nothing
End Sub