Alex,
Try placing an End statement at the end of your macro.
For example
Option Explicit
Public i As Integer
Public Sub Test()
i = i + 1
MsgBox i
End ' Try this with and with out this End statement
End Sub
Without i retains its value from run to run. With it i is reset to 0
everytime you run the macro.
*** Sent via Developersdex
http://www.developersdex.com ***