If one runs the following:
Sub scTest()
Dim sht As Worksheet, i As Integer, addresses As String, j As Integer
Set sht = Worksheets(1)
For j = 1 To 26
On Error Resume Next
sht.Scenarios("test").Delete
addresses = ""
For i = 1 To j
addresses = addresses & "$" & Chr(64 + i) & "$" & CStr(i) & ","
Next i
addresses = Left(addresses, Len(addresses) - 1)
addresses = Replace(addresses, "$", "")
Debug.Print "Before: " & Range(addresses).Count
sht.Scenarios.Add Name:="test", ChangingCells:=Range(addresses)
Debug.Print "After: " & sht.Scenarios("test").ChangingCells.Count
Next j
End Sub
one finds that the maximum number of cells one can add with vba is 24, which is less than the stated spec of 32 changing cells per scenario!
g
Bookmarks