Powerpoint Alchemy Amazing techniques and tips
Amazing techniques which will transform your use of PowerPoint presentations. Make your presentation stand out from the crowd!

About

Table Format Copy

Select a table that you have formatted exactly how you like it, run this and all other tables in the presentation will copy the format. Note the format of the first cell is used to set the overall format. If cells in a table have different formats they will all be set to the format of the first cell.

Sub tabufix()
Dim otbl As Table, osld As Slide, IRow As Integer, ICol As Integer,oshp as Shape
On Error GoTo errhandler
If ActiveWindow.Selection.ShapeRange.Count <> 1 Then GoTo errhandler
If ActiveWindow.Selection.ShapeRange.Type <> msoTable Then
MsgBox "You haven't selected a table"
Exit Sub
End If
Set otbl = ActiveWindow.Selection.ShapeRange.Table
With otbl
.Cell(1, 1).Shape.PickUp
End With
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoTable Then
For IRow = 1 To oshp.Table.Rows.Count
For ICol = 1 To oshp.Table.Columns.Count
oshp.Table.Cell(IRow, ICol).Shape.Apply
Next ICol
Next IRow
End If
Next oshp
Next osld
Exit Sub
errhandler:
MsgBox "Error, Did you select just one thing?"
End Sub

Note this is for 2003 style tables it will NOT work in 2007 onwards new style tables


Non Printing Shapes

Quite often you want to print out presentations but omit a number of shapes from the printout. You can adjust the Greyscale settings if you are printing in B&W but in colour it's not so easy. To use this vba you must first select the non printing shapes and in Format > Autoshape choose the "web" tab and enter a capital X in the box. Then run this code. The second sub routine puts the shapes back!

Sub gapprint()
On Error GoTo Errhandler
Dim osld As Slide, oshp As Shape
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.AlternativeText = "X" Then oshp.Visible = msoFalse
Next oshp
Next osld
ActiveWindow.ViewType = ppViewPrintPreview
Exit Sub
Errhandler:
MsgBox "Sorry there's an error!", vbCritical, "www.PPTAlchemy.co.uk"
End Sub

Sub showagain()
On Error GoTo Errhandler
Dim osld As Slide, oshp As Shape
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
oshp.Visible = msoTrue
Next oshp
Next osld
Exit Sub
Errhandler:
MsgBox "Sorry there's an error!", vbCritical, "www.PPTAlchemy.co.uk"
End Sub


Reverse the order of a Presentation

Sub reversi()
Dim opres As Presentation
Dim i As Integer
Set opres = ActivePresentation
'Cannot alter read only presentation
If opres.ReadOnly = True Then Exit Sub
'seqentially move slides to front
For i = 2 To opres.Slides.Count
opres.Slides(i).MoveTo 1
Next i
End Sub

More vba samples
How to use vba


 


This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and wales No.5780175