Excel, Hash (#) in VBA Calculations

  • Thread starter Thread starter SMS - John Howard
  • Start date Start date
S

SMS - John Howard

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
 
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 are:
Integer %
Long &
Currency @
Single !
Double #
String $
 
Rob,
Many thanks.
That certainly makes sense and puts everythng in place

Best regards

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top