Consulting

Results 1 to 4 of 4

Thread: ppt determine an active cell inside a table

  1. #1

    ppt determine an active cell inside a table

    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

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    Thank you! Now I understand.

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    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
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •