Log in

View Full Version : [SOLVED:] ppt determine an active cell inside a table



Mattthompson
09-14-2017, 04:26 AM
Hello,

I want to determine an active cell of a table in powerpoint.
To each cell I assigned a link via 'Insert => Action' to the macro below.
When working in development mode it works, but when I switch to presentation mode, it seems that there is a problem with the property 'selected'.
Thanks in advance for your help!

With SlideShowWindows(1).Presentation.Slides(2).Shapes(40).Table
'With ActivePresentation.Slides(2).Shapes(40).Table
For iTS = 1 To .Columns.Count
For jTS = 1 To .Rows.Count
If .Cell(jTS, iTS).Selected Then
strCell = .Cell(jTS, iTS).Shape.TextFrame.TextRange.Text
Exit For
End If
Next
If jTS <= .Columns.Count Then
If .Cell(jTS, iTS).Selected Then
Exit For
End If
End If
Next
End With

John Wilson
09-14-2017, 09:31 AM
You cannot select a table cell (or anything else) in show mode so that's why the code fails. You also cannot add an Action to cells so I guess you mean text in the cell?

Mattthompson
09-19-2017, 10:31 PM
Thank you! Now I understand.

Paul_Hossler
09-20-2017, 07:02 AM
A workaround would be to Insert a transparent shape over each table cell, Arrange the shapes to Front, and then Insert an Action to call a macro for each shape