S
sharon
I see a weird behaviour in VBA code, not always but from time to time.
I've seen this in more than one workbook, so I'd like to know how to fix it.
Having (line numbers are just for explanation purposes)
001 For each cel in range("rTotal")
002 cel.offset(0,2)="x"
003 Next
.....
.....
100 Function anYthing( xLOL as string) as string
101 Application.Volatile True
102 Sheets("STAT").Select
103 Range("lVAL").Select
104 Sw = Sw + 1
105 If Sw > 250 Then
106 MsgBox ("Times: " + Str(Sw))
107 End If
108 anYthing="anything"
109 Function End
While normal flow would be looping through steps 1 -2 -3 some times I can
see (while debugging) that flow is 1 - 2 - and looping (several times) steps
103 104 - 100, which is a function actually not invoked.
Eventually it goes back to 3-2-1
Any clue?
Sharon
I've seen this in more than one workbook, so I'd like to know how to fix it.
Having (line numbers are just for explanation purposes)
001 For each cel in range("rTotal")
002 cel.offset(0,2)="x"
003 Next
.....
.....
100 Function anYthing( xLOL as string) as string
101 Application.Volatile True
102 Sheets("STAT").Select
103 Range("lVAL").Select
104 Sw = Sw + 1
105 If Sw > 250 Then
106 MsgBox ("Times: " + Str(Sw))
107 End If
108 anYthing="anything"
109 Function End
While normal flow would be looping through steps 1 -2 -3 some times I can
see (while debugging) that flow is 1 - 2 - and looping (several times) steps
103 104 - 100, which is a function actually not invoked.
Eventually it goes back to 3-2-1
Any clue?
Sharon