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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,215,352
Messages
6,124,457
Members
449,161
Latest member
NHOJ

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