ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set Integer Variables back to Zero (https://www.excelbanter.com/excel-programming/378896-re-set-integer-variables-back-zero.html)

NickHK

Set Integer Variables back to Zero
 
You can reset non-object variables to their default values using Empty:

Dim i As Long
Dim s As String

i = 10
s = "ttt"

i = Empty
s = Empty
Debug.Print i, Len(s)

Object require Nothing ;
Dim o as object
Set o=Nothing

NickHK

"Kou Vang" wrote in message
...
I am running several loops and was wondering how do I reset the Integer
variables back to 0? I tried putting the Dim Statements inside the loop

but
that didn't work. This must be so easy, but it's like math, I don't

remember
remedial stuff only what's most recent. Same goes in

programming...Sigh...

Kou





All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com