VBA for generating units table

ajaysomasi

New Member
Joined
Mar 6, 2017
Messages
22
Hi everyone

I'm looking for VBA code to develop a Units table as an output as explained below.. I have a lot of units to organize, hence a code will help solve my problem quickly.. Appreciate your help..

I have units in the following manner:

1 m = 100 cm
1 m = 1000 mm
1 m = 0.001 km

I want a table that lists out the conversion for all possible combinations.. The output for the above input will look like this:

Original unitConversionTarget unit
m100cm
m1000mm
m0.001km
cm0.01m
cm10mm
cm0.00001km
mm0.001m
mm0.1cm
mm0.000001km
km1000m
km1000000mm
km100000cm
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Watch MrExcel Video

Forum statistics

Threads
1,123,015
Messages
5,599,351
Members
414,306
Latest member
Dennis_vdw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top