Using Checkbox Information on Worksheet

Boechat

New Member
Joined
Jul 16, 2016
Messages
44
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:


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!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,223,914
Messages
6,175,351
Members
452,638
Latest member
Oluwabukunmi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top