Excel VB macro works in Normal mode but not in Step Mode
Hi,
I am at my wit's end. I have (what is now) a very small Excel spreadsheet and VB macro that works when I run it in Normal mode but generates an overflow error when I run it in Step mode. [See the Addendum below for specific details.]
The error is with my MacBook pro. The macro runs in Normal and Step mode on another MacBook pro and on a Windows PC.
In an attempt to resolve the problem I have upgraded from Mojave to macOS Catalina Version 10.15.3 and to Excel version 16.34). I did have problems upgrading my software: attempts to upgrade my operating system and Excel would fail. With help from Apple I have solved that problem.
But I am still left with this glitch.
I am hoping someone might be able to give me a suggestion or two.
Thank you for your help.
David
ADDEMDUM:
My spreadsheet has two ranges, value and valueItems. Each range has three items, each item being a whole number between 0 and 50.
The macro code is:
Public value As Range
Public valueItems As Range
Public variable() As Single
Sub FilterAnalysis()
Set value = Range("value")
Set valueItems = Range("valueItems")
For i = 1 To 3
ReDim variable(valueItems(i))
For j = 1 To valueItems(i)
variable(j) = value(i)
Next j 'Macro fails here with overflow error in Step mode. Works OK in Normal mode
Next i
msg = "Macro completed successfully"
Title = "SUCCESS!"
response = MsgBox(msg, , Title)
Sheets("test").Select
Range("A1").Select
End Sub
MacBook Pro 13", macOS 10.14