Losing decimals when delaring public variable as Integer

VBnovice

New Member
Joined
Nov 7, 2005
Messages
17
I am using the following:

Public part_3_cost As Integer

then later:

Activecell.Value = part_3_cost
line_value = part_3_cost x part_3_quantity

trouble is I lose the decimals for part_3_cost, ie 0.33 becomes 0 and 1.33 becomes 1.0

How should I be declaring this? :confused:
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Watch MrExcel Video

Forum statistics

Threads
1,118,820
Messages
5,574,511
Members
412,599
Latest member
Schu94
Top