Excel macro - Edit text in text boxes, which is grouped

Post Reply
wwj
Posts: 2497
Joined: 27 Jan 2007 08:16

Excel macro - Edit text in text boxes, which is grouped

Post by wwj »

Excel macro - Edit text in text boxes, which is grouped

Code: Select all

    Dim pgText As TextFrame2
    Dim plotSheet As String

    plotSheet = "Plots"

    ' Update page numbers on the plots.
    i = 0
    For Each objShp In Worksheets(plotSheet).Shapes
        i = i + 1
        Set pgText = ActiveSheet.Shapes(objShp.Name).GroupItems("PageNo").TextFrame2
        pgText.TextRange.Characters.Text = "Page " & CStr(i) & " of " & CStr(maxNumPlot)
    Next

Post Reply