ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel, Hash (#) in VBA Calculations (https://www.excelbanter.com/excel-programming/324203-excel-hash-vba-calculations.html)

SMS - John Howard

Excel, Hash (#) in VBA Calculations
 
Hi Folks,

I have recently inherited care of an Excel XP model that contains the
following calculations, containing the # symbol.

Amount = Amount / 100#
NewValue = OldValue * -1#

I can see where the variables Amount, NewValue and Old Value are declared
but nothing on the #.

The end results sor t of make sense if the # symbols were in fact the %
sign. Other than that I am totally confused.

Does this use of the # symbol make sense to anyone.

TIA

John Howard
Sydney, Australia



Rob van Gelder[_4_]

Excel, Hash (#) in VBA Calculations
 
It is whats referred to as a Type Declaration Character.

It means that when the expression is evaluated, the number in front of the
type declaration character is treated as a specific data type instead of as
a Variant.

The type-declaration character for Double is the number sign (#).

The list of type declaration characters a
Integer %
Long &
Currency @
Single !
Double #
String $

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"SMS - John Howard" wrote in message
...
Hi Folks,

I have recently inherited care of an Excel XP model that contains the
following calculations, containing the # symbol.

Amount = Amount / 100#
NewValue = OldValue * -1#

I can see where the variables Amount, NewValue and Old Value are declared
but nothing on the #.

The end results sor t of make sense if the # symbols were in fact the %
sign. Other than that I am totally confused.

Does this use of the # symbol make sense to anyone.

TIA

John Howard
Sydney, Australia





SMS - John Howard

Excel, Hash (#) in VBA Calculations
 
Rob,
Many thanks.
That certainly makes sense and puts everythng in place

Best regards

John

"Rob van Gelder" wrote in message
...
It is whats referred to as a Type Declaration Character.

It means that when the expression is evaluated, the number in front of the
type declaration character is treated as a specific data type instead of

as
a Variant.

The type-declaration character for Double is the number sign (#).

The list of type declaration characters a
Integer %
Long &
Currency @
Single !
Double #
String $

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"SMS - John Howard" wrote in message
...
Hi Folks,

I have recently inherited care of an Excel XP model that contains the
following calculations, containing the # symbol.

Amount = Amount / 100#
NewValue = OldValue * -1#

I can see where the variables Amount, NewValue and Old Value are

declared
but nothing on the #.

The end results sor t of make sense if the # symbols were in fact the %
sign. Other than that I am totally confused.

Does this use of the # symbol make sense to anyone.

TIA

John Howard
Sydney, Australia








All times are GMT +1. The time now is 05:12 PM.

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