blackorchids2002
Board Regular
- Joined
- Dec 29, 2011
- Messages
- 138
Hi Masters,
Good day! I need your expertise on the how to loop by using range in my excel sheet.
I have check boxes where I assigned the ff:
Check Box1 : Full day ( Date From : input field is found in column D20) and Date To: input in column E20)
Check Box2: Half Day ( Date From : input field is found in column D21) and Date To: input in column E21)
Check Box3: Maternity ( Date From : input field is found in column D22) and Date To: input in column E22)
Check Box4: Bereavement ( Date From : input field is found in column D22) and Date To: input in column E22)
I want the loop code to be applied on ".Start" & ".End" codes below.
If they selected one of the checkboxes, let say Checkbox3, then the loop for ".Start" code should capture the "Date From" column and .End code to "Date To" column.
Sub test ()
Dim oApp As Object, oApt As Object
'to create a clendar invite
Set oApp = CreateObject("Outlook.Application")
Set oApt = oApp.CreateItem(1)
With oApt
.Subject = "PTO REQUEST APPROVED"
.Start = Now()
.End = Now()
.MeetingStatus = 1
.RequiredAttendees = ThisWorkbook.Sheets("PTO Request Form").Range("J8")
.BusyStatus = 3
.AllDayEvent = True
.ReminderSet = False
.Attachments.Add ThisWorkbook.FullName
.Display
.Send
End With
Appreciate all your help on this.
Thanks,
blackorchids2002
Good day! I need your expertise on the how to loop by using range in my excel sheet.
I have check boxes where I assigned the ff:
Check Box1 : Full day ( Date From : input field is found in column D20) and Date To: input in column E20)
Check Box2: Half Day ( Date From : input field is found in column D21) and Date To: input in column E21)
Check Box3: Maternity ( Date From : input field is found in column D22) and Date To: input in column E22)
Check Box4: Bereavement ( Date From : input field is found in column D22) and Date To: input in column E22)
I want the loop code to be applied on ".Start" & ".End" codes below.
If they selected one of the checkboxes, let say Checkbox3, then the loop for ".Start" code should capture the "Date From" column and .End code to "Date To" column.
Sub test ()
Dim oApp As Object, oApt As Object
'to create a clendar invite
Set oApp = CreateObject("Outlook.Application")
Set oApt = oApp.CreateItem(1)
With oApt
.Subject = "PTO REQUEST APPROVED"
.Start = Now()
.End = Now()
.MeetingStatus = 1
.RequiredAttendees = ThisWorkbook.Sheets("PTO Request Form").Range("J8")
.BusyStatus = 3
.AllDayEvent = True
.ReminderSet = False
.Attachments.Add ThisWorkbook.FullName
.Display
.Send
End With
Appreciate all your help on this.
Thanks,
blackorchids2002