Hello,
I've been working on a macro that will create a meeting maker from a roster in excel 2010. I have a workbook where each sheet is a roster for training that multiple people use, for this reason and for learning reasons I'm doing this in VBA.
In my roster I have several columns for different data for each row but for this example this is what I'm having issues with:
Column E Column F Column G Column H
Emails Class Name Date Time
John.Doe TrainingA 11-APR-12 0830-0930
Jane.Doe TrainingA 11-APR-12 0930-1030
Karen.Doe TrainingA 12-APR-12 1330-1430
Lisa.Doe TrainingA 12-APR-12 1330-1430
Meg.Doe TrainingA 12-APR-12 1330-1430
Jack.Doe TrainingA 12-APR-12 1330-1430
As we update the roster by entering the training into their schedule (seperate 3rd party app) we update our roster with the date and time we scheduled them for. Since we typically schedule people in groups of 8 to 16 at a time I've setup a macro that will create an outlook appointment and will populate the class name, course number, location, and names from highlighted cells.
I've set it up so that we would highlight a range of recently entered start/end times (column H) for a group that would share the same session as that's the last thing entered when setting up a group. I have an offset code to collect their names off of the initial selection and insert into my outlook appointment which works perfectly. Example, user selects range of eight 1330-1430 times. I need vba to see just one cell out of that and trim it to be 1330 and set the start time for the appointment.
I'm having trouble taking a single cell from that initial selected range. Once I get one cell trimmed I need to format it and set it to the appointment time.
I've tried the following with no luck:
&
I've got most of this working on my own but need a little help if possible, I can upload a spreadsheet if need be via dropbox as I don't have access to a file sharing service otherwise.
I've been working on a macro that will create a meeting maker from a roster in excel 2010. I have a workbook where each sheet is a roster for training that multiple people use, for this reason and for learning reasons I'm doing this in VBA.
In my roster I have several columns for different data for each row but for this example this is what I'm having issues with:
Column E Column F Column G Column H
Emails Class Name Date Time
John.Doe TrainingA 11-APR-12 0830-0930
Jane.Doe TrainingA 11-APR-12 0930-1030
Karen.Doe TrainingA 12-APR-12 1330-1430
Lisa.Doe TrainingA 12-APR-12 1330-1430
Meg.Doe TrainingA 12-APR-12 1330-1430
Jack.Doe TrainingA 12-APR-12 1330-1430
As we update the roster by entering the training into their schedule (seperate 3rd party app) we update our roster with the date and time we scheduled them for. Since we typically schedule people in groups of 8 to 16 at a time I've setup a macro that will create an outlook appointment and will populate the class name, course number, location, and names from highlighted cells.
I've set it up so that we would highlight a range of recently entered start/end times (column H) for a group that would share the same session as that's the last thing entered when setting up a group. I have an offset code to collect their names off of the initial selection and insert into my outlook appointment which works perfectly. Example, user selects range of eight 1330-1430 times. I need vba to see just one cell out of that and trim it to be 1330 and set the start time for the appointment.
Code:
Dim USelect As Range
Dim AgentName As Range
Dim l As Range
Dim k As String
‘this takes the selected range and offsets and gets the emails for all class participants
Set USelect = Selection
For Each AgentName In USelect
strbody6 = strbody6 & AgentName.Offset(0, -3).Value & vbNewLine
Next
I've tried the following with no luck:
Code:
k = Left(USelect, 4)
Code:
l = Range(ActiveCell, Selection.End(xlDown)).Value
k = l.Value
k = Trim(Left(l, 4))
I've got most of this working on my own but need a little help if possible, I can upload a spreadsheet if need be via dropbox as I don't have access to a file sharing service otherwise.