Ok, based on your suggestions, I modified my code to this:
[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
'APPEND all text together into temp variable
tempText = tempText & shp.TextFrame.TextRange & Chr$(13)
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", 4)
rowsReply = InputBox("How many rows?", "Rows", 4)
'dump the text into an array
txtArray() = Split(tempText, vbCr)
'(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)
With oTable
'Paste the contents of the array in reverse order into the table
For I = UBound(txtArray) To 0 Step -1
'do something with txtArray(i)
For M = 1 To rowsReply
For N = 1 To colsReply
.Cell(M, N).Shape.TextFrame.TextRange.Text = txtArray(I)
Next N
Next M
Next I
End With
ElseIf Response = vbNo Then ' User chose No
MyString = "No"
'dump the value of the tempText on the slide
ActivePresentation.Slides(mySlide).Shapes.AddTextbox(msoTextOrientationHori zontal, _
Left:=25.2, Top:=68.25, Width:=100, Height:=100).TextFrame.TextRange.Text = tempText
End If
End Sub
[/vba]
But it's still not putting the contents of the array into the cells. I'm not sure what I'm doing wrong. I tried replacing
with.Cell(M, N).Shape.TextFrame.TextRange.Text = txtArray(I)and it still didn't put text in the table, so I'm not sure what's going on..Cell(M, N).Shape.TextFrame.TextRange.Text = "test"