Formatting table in VBA

  • Thread starter Michael Clavien
  • Start date
M

Michael Clavien

Hi,

I am populating a table with VBA. I need to format a field like this

If the value is less than 100000 than add 30000000 to the value
if the value is more than 100000 then add 400000000 to the value

What would be the easiest way to do this?


Thanks

Michael Clavien
Unit 1, 1 Gordon St CAMPERDOWN NSW 2050 Australia
Ph: +61 2 9519 6650
Power Electronics & Industrial Control Solutions
 
D

Douglas J. Steele

What do you want to do if the value is 100000?

If MyValue <= 100000 Then
MyValue = MyValue + 30000000
Else
MyValue = MyValue + 400000000
End If

or

MyValue = MyValue + IIf(MyValue <= 100000, 30000000, 400000000)
 
M

Michael Clavien

Thanks Douglas,
It is a much simpler solution than expected

Regards Michael Clavien Unit 1, 1 Gordon St CAMPERDOWN NSW 2050 Australia
Ph: +61 2 9519 6650 Fax +61 2 9519 7460 Power Electronics & Industrial
Control Solutions
 

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

Top