0

I have a vba tool which analyzes the excel data and counts the number of data for a particular person and prepares powerpoint reports by pasting the comments for each person based on it. I have noticed, the tool throws error when the data count (rows) for a person increases 16. The error says- "integer is out of range. 18 is not in the valid range of 1 to 17" . Below is the code:

Note- I am a beginner

' Update Comments Slide

Set Sl = PPres.Slides(4)
Set sh = Sl.Shapes("TextBox 7")
strText = sh.TextFrame.TextRange.Text
strText = Replace(strText, "____", strFirst)
sh.TextFrame.TextRange.Text = strText

Set sh = Sl.Shapes("Table Placeholder 3")
For s = 1 To aA
  sh.Table.Rows(s + 1).Cells(1).Shape.TextFrame.TextRange.Text = CStr(clsCommA.Item(s))
Next
If aA < 16 Then
    For s = 16 To aA + 1 Step -1
        sh.Table.Rows(s + 1).Delete
    Next
End If
Set clsCommA = Nothing
BigBen
  • 46,229
  • 7
  • 24
  • 40
LearnerP
  • 1
  • 1

0 Answers0