-
Ok, just to make sure I know what's going on:
[vba]Istart = Int(Right$(.Name, Len(.Name) - 10))[/vba] This line basically takes the name of the selected shape, parses the number out of it and assigns it to Istart. So basically I can't select a shape with a name more than 99 (god I hope I never have a table with that many cells!)
That part I understand (clever by the way).. ;)
This is where I got confused:
[vba]For iC = 1 To .Columns.Count
.Cell(iR, iC).Shape.TextFrame.TextRange = osld.Shapes("Rectangle " & CStr(Istart + adj)).TextFrame.TextRange
osld.Shapes("Rectangle " & CStr(Istart + adj)).Delete
adj = adj + 1
Next iC[/vba] What does the CStr(Istart + adj)) part of that code do? What is adj for?
-
Point 1
It should parse any number It basically takes the name and strips out "Rectangle " (10 letters inc the space)
Point 2
The adj(ust) just adds one to the number for each new cell. CStr converts the number to a string
eg
"Rectangle " & CStr(6) = "Rectangle 6"
then "Rectangle 7"
then "Rectangle 8" etc
This puts the correct textrange into the correct cell (hopefully)
Note this will hardly ever start at Rectangle 1 because of the way PPT names shapes (in the testing I was on Rectangle 297!!)
-
John -- I am consistantly impressed by your knowledge of the nuances of PP and getting VBA to do things
:beerchug:
You are NOT allowed to ever let your VBX membership expire :thumb
Paul
-