Symbol # after numbers
Hi, I found a code that uses the symbol # after some numbers, what is the
function of this? This is part of the code If N < 2 Or beta <= 0# Or beta = 1# Or Alpha <= 0# Or Alpha = 1# Then Tol2 = CDbl(CVErr(xlErrValue)) Exit Function End If c = 1# / Sqr(2# * 3.14159265358979) Thanks. |
Symbol # after numbers
It just defines the data type. It helps to keep VBA from getting confused.
-- Gary''s Student - gsnu200909 "Marcus" wrote: Hi, I found a code that uses the symbol # after some numbers, what is the function of this? This is part of the code If N < 2 Or beta <= 0# Or beta = 1# Or Alpha <= 0# Or Alpha = 1# Then Tol2 = CDbl(CVErr(xlErrValue)) Exit Function End If c = 1# / Sqr(2# * 3.14159265358979) Thanks. |
Symbol # after numbers
That signifies significant digits. For example, if you type beta = 1.00000,
VBA will automatically revice the syntax to bets = 1#, but if you type beta = 1, VBA leaves that syntax alone. Try it yourself. Hope this helps! If so, let me know, click "YES" below. -- Cheers, Ryan "Marcus" wrote: Hi, I found a code that uses the symbol # after some numbers, what is the function of this? This is part of the code If N < 2 Or beta <= 0# Or beta = 1# Or Alpha <= 0# Or Alpha = 1# Then Tol2 = CDbl(CVErr(xlErrValue)) Exit Function End If c = 1# / Sqr(2# * 3.14159265358979) Thanks. |
Symbol # after numbers
Hello,
Its just telling VBA that the constant is of type double so it does not need to get casted (VBA will never get irritated :-) # -- Double % -- Integer & -- Long @ -- Currency ! -- Single $ -- String [found in the web] Regards, Bernd |
All times are GMT +1. The time now is 08:33 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com