user2828701
user2828701

Reputation: 305

VBA Each Excel Cell as Bullet point in Powerpoint

I am trying to take the information in a range of cells and have each cell display as a bullet point within powerpoint.

For example

Cell A1 = My Sample Text 1
Cell A2 = My Sample Text 2
Cell A3 = My Sample Text 3

I want each to be bulleted in powerpoint like so.

The main point I want to get across is the number of cells is dynamic, sometimes I will have 3, other times I might have 5, etc. which is why I am using CurrentRegion.

Here's What I have so far

Range("A1").CurrentRegion.Copy
For Each Cell In Range("A1").CurrentRegion.Cells
ppSlide.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
        Left:=400, _
        Top:=150, _
        Width:=350, _
            Height:=50).TextFrame.TextRange.Paste
ppSlide.Shapes(1).TextFrame.TextRange.Paste.ParagraphFormat.Bullet.Type = ppBulletUnnumbered

Next Cell

Any thoughts on why this may not be working?

Upvotes: 0

Views: 1140

Answers (1)

grug.0
grug.0

Reputation: 355

Declare "Cell" as a Range Object, and add something like this if you haven't:

Dim Cell As Range
Dim cellvalue As String

'{loop} 
For Each Cell in Range("A1").CurrentRegion
    cellvalue = Cell.Value
    ppSlide.shapes'.... use cellvalue for bullet
Next
'{end loop}

Upvotes: 1

Related Questions