Hey everyone,
I'm currently working on a project, where a Userform generates a PDF report.
It already extracts Project Title, Project Area and saves it to a chosen destiny location.
I also have a Listbox containing checkboxes and multiple selection in the same form. What I want it to do is, for the checked Items in the listbox, to be pasted to the report inside the Shape "Rectangle 1". This code should go in the code where the rex X's are now.
The code I'm currently using follows below:
Thanks for your support!
I'm currently working on a project, where a Userform generates a PDF report.
It already extracts Project Title, Project Area and saves it to a chosen destiny location.
I also have a Listbox containing checkboxes and multiple selection in the same form. What I want it to do is, for the checked Items in the listbox, to be pasted to the report inside the Shape "Rectangle 1". This code should go in the code where the rex X's are now.
The code I'm currently using follows below:
Code:
Private Sub TaskButton_Click()
Dim Success As Integer
Dim str As String
Sheets("New Project Sheet").Select
[COLOR=#006400]'Project Title[/COLOR]
Sheets("New Project Sheet").Shapes.Range(Array("Rectangle 2")).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = TextBox1.Value
[COLOR=#006400]'Project Area[/COLOR]
Sheets("New Project Sheet").Shapes.Range(Array("Rectangle 3")).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = ComboBox1.Value
[COLOR=#006400]'Task Selection[/COLOR]
[COLOR=#ff0000]XXXXXXXXXXXXXXXXXX[/COLOR]
[COLOR=#006400]'Save Direction[/COLOR]
str = TextBox2.Value & "\"
ActiveSheet.ExportAsFixedFormat xlTypePDF, str & TextBox1.Value & ".pdf"
[COLOR=#006400]'Success Message[/COLOR]
Success = MsgBox("PDF has been generated")
Unload NewProject
Waze.Show
End Sub
____________________________________________________
Private Sub UserForm_Initialize()
ComboBox1.AddItem "Product Development"
ComboBox1.AddItem "Tech Transfer"
ComboBox1.AddItem "Raw Material Center"
ComboBox1.AddItem "Analytical & Micro & Stability"
ComboBox1.AddItem "Packaging"
ComboBox1.AddItem "Regulatory Affairs"
End Sub
______________________________________________________
Private Sub ComboBox1_Change()
Call Fill
With ListBox1
End With
End Sub
_______________________________________________________
Sub Fill()
ListBox1.List = Sheets(ComboBox1.Text).Range("A2:A42").Value
End Sub
Thanks for your support!