It's only returning letters in the cells instead of the actual text from the original table. I played around with the code and to be honest, I'm not sure how I got it to work, but for what it's worth, I'll post it below.
[vba]Sub MergeText()
'On Error Resume Next
Dim shp As Shape
Dim mySlide As Integer
Dim tempText As String
Dim Response As Long
Dim rowsReply As Long, colsReply As Long
Dim MyString As String
Dim oTable As Table
Dim I As Long, M As Long, N As Long
Dim txtArray() As String
'go through everything in the current selection & get the text
mySlide = ActiveWindow.View.Slide.SlideIndex
With ActiveWindow.Selection
If .Type = ppSelectionShapes Then
For Each shp In .ShapeRange
If shp.HasTextFrame Then
'Check for forward or reverse order
If .ShapeRange(1).Left < .ShapeRange(.ShapeRange.Count).Left Then
tempText = shp.TextFrame.TextRange & Chr$(135) & tempText
Else
tempText = tempText & shp.TextFrame.TextRange & Chr$(135)
End If
End If
Next shp
End If
End With
'Ask if the selection used to be a table
'If NO, paste normally | If YES, paste the text in reverse order
Response = MsgBox("Is the selection an ungrouped table?", 3, "Please answer...")
If Response = vbYes Then ' User chose Yes
MyString = "Yes"
'Ask how many rows and columns
colsReply = InputBox("How many columns?", "Columns")
rowsReply = InputBox("How many rows?", "Rows")
'dump the text into an array
txtArray() = Split(tempText, Chr$(135))
'(size of table based on rowsReply, colsReply)
ActivePresentation.Slides(mySlide).Shapes.AddTable(rowsReply, colsReply).Name = "temptable" & mySlide
Set oTable = ActivePresentation.Slides(mySlide).Shapes("temptable" & mySlide).Table
'Paste the contents of the array in reverse order into the table
For I = 0 To (UBound(txtArray) - 1) 'account for array starts at zero
'do something with txtArray(i)
M = (I \ colsReply) + 1 ' note \ = integer division
N = (I Mod colsReply) + 1
oTable.Cell(M, N).Shape.TextFrame.TextRange = txtArray(I)
Next I
ElseIf Response = vbNo Then ' User chose No
MyString = "No"
'dump the value of the tempText on the slide
txtArray() = Split(tempText, Chr$(135))
For I = 0 To (UBound(txtArray) - 1)
If I = 0 Then
tempText = txtArray(I) & vbCr
Else
tempText = tempText & txtArray(I) & vbCr
End If
Next I
ActivePresentation.Slides(mySlide).Shapes.AddTextbox(msoTextOrientationHori zontal, _
Left:=25, Top:=68, Width:=100, Height:=100).TextFrame.TextRange.Text = tempText
End If
End Sub
[/vba]
It's probably not the best solution (mine never are) but I'm satisfied enough to mark the thread solved. Thanks for all your help.![]()