We help IT Professionals succeed at work.

# Combobox formular for form load

on
I am after formula help

I have a combobox and i need it to list currency in increments of 10 cents

I have this

Dim h
Dim h1 As String
For h = 1 To 50
h1 = h + 0.1
Next h

But the results of this is
\$1.1
\$2.1
\$3.1
etc
What I need is
\$1.10
\$1.20
\$1.30
etc

The formula need to start from \$1.00 up to \$5.00
Comment
Watch Question

## View Solution Only

Full Stack .NET Developer
Commented:
Hello try:
``````            Dim h as Integer
Dim h1 As Decimal = 0
For h = 1 To 50
h1 += 0.1
Next h
``````
Full Stack .NET Developer

Commented:
Also you can try:
``````Dim h as Integer
Dim h1 As Decimal = 0
For h = 1 To 50
h1 += 0.1
Next h
``````

Commented:
Thks
Full Stack .NET Developer

Commented:
You're welcome, but I think that you really need is this:
``````Dim h1 As Decimal = 1
Dim txt As String
Do While h1 <= 5
h1 += 0.1
Loop
``````
Full Stack .NET Developer

Commented:
Ignore line #2

Commented:
yv989c:

Thanks I just added an if statement in to handle the > \$1
So all good thks for your help