Combo Box

G

Guest

How Do I create a Combo box in Powerpoint?
I need to add a list, where you select in slide 1,
Week1
Week2
Week3
Week4
Week5

Thanks
JPG
 
G

Guest

JuanPablo
You can only do this with vba

The code would be

Sub fillit()
With ActivePresentation.Slides(1).Shapes("ComboBox1").OLEFormat.Object
..AddItem "Week1"
..AddItem "Week2"
'etc
End With
End Sub

If you want to use the selection to do anything you will need more vba
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
G

Guest

Thanks,
But where should I add the code?

JP

John Wilson said:
JuanPablo
You can only do this with vba

The code would be

Sub fillit()
With ActivePresentation.Slides(1).Shapes("ComboBox1").OLEFormat.Object
.AddItem "Week1"
.AddItem "Week2"
'etc
End With
End Sub

If you want to use the selection to do anything you will need more vba
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
G

Guest

I would probably make either an action button os slide one with a setting of
run macro (code in a vbe module) Have a read of our tutorials on vba here if
this means nothing
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html

or Possibly easier would be to add a command button from the control toolbox
where the combo box was and right click > view code add the code between the
two lines you will see. You need to omit my sub Fillit line and the end sub
line as they will aready be there.
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
G

Guest

Ok
I added a combo box with the following code:

Private Sub ComboBox1_Change()

With ActivePresentation.Slides(1).Shapes("ComboBox1").OLEFormat.Object
..AddItem "Week1"
..AddItem "Week2"
End With

End Sub

But when I run the slide, the comobo box appears empty.
 
G

Guest

No that won't work (and its not what I said!)

You can add the code to the combo box though

Right click > view code You should see a drop down ment top right with
"Change" in it?
Change this to "dropbuttonclick" and put the code between the new lines that
appear:

Private Sub ComboBox1_DropButtonClick()

End Sub

Does that work?
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
G

Guest

Ok,


Private Sub ComboBox1_DropButtonClick()

With ActivePresentation.Slides(1).Shapes("ComboBox1").OLEFormat.Object
..AddItem "Week1"
..AddItem "Week2"
End With

End Sub

Still, the box appears in blank.

JPG
 
G

Guest

You are looking at the box in a show aren't you?
Also using this method you would want to clear the items each time they are
oped otherwise the list will keep getting added to! You can also specify the
default value

With ActivePresentation.Slides(1).Shapes("ComboBox1").OLEFormat.Object
..Clear
..AddItem "Week1"
.AddItem "Week2"
..value="Week1" 'initial value
End With
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Too many fields defined 1
macro problem for a noob lol 1
Report by monthly 1
forecasting? 10
Can this type of Report be Produced? 3
EXCEL FUNCTION OR FORMULA 13
Complex average query 7
Counting the largest... 2

Top