PDA

View Full Version : Powerpoint and Tables



ILMV
07-13-2007, 05:17 PM
Hi guys hows it going...

I have come in need of help, dont worry I have looked around VBAX and as much as Google as my mind can handle.

I am using Powerpoint 2007 to make a 97-2003 Compatible Presentation.

I have a table that comprises of 3 columns and 5 rows.

Q - What code is needed to edit a particular cell of any given table?

Thanks people :cool:


Edit: And just to let you know, I do not want to use an Excel based table, just a native table in Powerpoint.

Andy Pope
07-14-2007, 07:45 AM
Hi,

Try this. Changing reference to slide and shape to suit your presentation.



Sub ModTable()
Dim pptTable As Table
Dim lngRow As Long
Dim lngCol As Long
Set pptTable = ActivePresentation.Slides(1).Shapes(3).Table
For lngRow = 1 To pptTable.Rows.Count
For lngCol = 1 To pptTable.Columns.Count
pptTable.Cell(lngRow, lngCol).Shape.TextFrame.TextRange.Characters.Text = _
"(" & lngRow & "," & lngCol & ")"
Next
Next
End Sub

John Wilson
07-14-2007, 10:25 PM
Shyam has a few articles on this too which are worth a read. Scroll down to Table borders and manipulating tables.
http://skp.mvps.org/vba.htm