t0ny84
Board Regular
- Joined
- Jul 6, 2020
- Messages
- 205
- Office Version
- 365
- 2016
- 2013
- Platform
- Windows
- Mobile
- Web
Hi All,
I am trying to modify the following macro I found online to suit my requirements, the below code takes the Date from cell N6 and the Appointment from N7 and adds it to the bottom of a table. I am trying to set this up so I can have the option to add in an event multiple times to save having to manipulate the data within the table.
I was thinking of having a drop down list of with Once Off \ Weekly \ Monthly.
Once Off - would add the entry as per the code below.
Weekly - would add the entry to the table and then add 51 more lines to the table with the date being incremented by 7 days
Fortnightly - would add the entry to the table and add 26 more lines to the table with the date being incremented by 14 days.
Thanks in advance!
t0ny84
I am trying to modify the following macro I found online to suit my requirements, the below code takes the Date from cell N6 and the Appointment from N7 and adds it to the bottom of a table. I am trying to set this up so I can have the option to add in an event multiple times to save having to manipulate the data within the table.
I was thinking of having a drop down list of with Once Off \ Weekly \ Monthly.
Once Off - would add the entry as per the code below.
Weekly - would add the entry to the table and then add 51 more lines to the table with the date being incremented by 7 days
Fortnightly - would add the entry to the table and add 26 more lines to the table with the date being incremented by 14 days.
VBA Code:
Sub AddEvent()
Lrow = Worksheets("Schedule").Range("B" & Rows.Count).End(xlUp).Row + 1
Worksheets("Schedule").Range("B" & Lrow) = ActiveSheet.Range("N6")
Worksheets("Schedule").Range("C" & Lrow) = ActiveSheet.Range("M6")
ActiveSheet.Range("M6:N6") = ""
SortTable
End Sub
Thanks in advance!
t0ny84