zohebnoorani
New Member
- Joined
- Jun 25, 2018
- Messages
- 2
I am not sure if this is possible, but it seems like theoretically it could be done. I am trying to create a Macro that pops up a userform with a list of courses. Once the user has selected the relevant courses and started the generation process, I would like for the code to be able to first see which courses were selected and then go get the corresponding courses and combine them into a single PDF saved on the computer.
I currently have a UserForm with a few test courses and a code that will display the form and allow the user to select courses. As of right now once the courses are selected and the generation button is clicked the code shows a message box with the name of the course selected in individual message boxes (just to verify it is reading the checkboxes). The problem I am having is trying to have the checkboxes correspond to a file path. Then to have it keep a list of the files that need to be merged.
I have already seen some help on how to use VBA and Microsoft Print to PDF.
Below is the code that I currently have.
I currently have a UserForm with a few test courses and a code that will display the form and allow the user to select courses. As of right now once the courses are selected and the generation button is clicked the code shows a message box with the name of the course selected in individual message boxes (just to verify it is reading the checkboxes). The problem I am having is trying to have the checkboxes correspond to a file path. Then to have it keep a list of the files that need to be merged.
I have already seen some help on how to use VBA and Microsoft Print to PDF.
Below is the code that I currently have.
Code:
Private Sub CourseSelector_Initialize()
End Sub
Private Sub Build_Click()
Dim C As MSForms.Control
For Each C In Me.Controls '<--| loop through userform controls
If TypeName(C) = "CheckBox" Then
If C.Value = True Then
MsgBox C.Caption
End If
End If
Next C
End Sub
Code:
Sub Butt*******()
CourseSelector.Show
End Sub