Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi people, hope you can help me
I need a macro to do the following: 1. A1 contains a value - 2 (which determines the number of decimal places 2. A2 contains a value - 10 3. A3 gives the results - i.e A1 is number of decimal places for A2 therefore = 1.0 Can this be done Thank you for your help Hayley |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hayley,
it can be done, but is there any reason why this would have to be done with a macro? The easiest way would just be to have a formula dividing A2 by 10 to A1-th power like this: =A2/(10^A1) The equivalent in VBA would be something like: Cells(3,1).value = cells(2,1).value/(10 ^ Cells(1,1).value) Cheers, Pete -----Original Message----- Hi people, hope you can help me. I need a macro to do the following:- 1. A1 contains a value - 2 (which determines the number of decimal places) 2. A2 contains a value - 104 3. A3 gives the results - i.e A1 is number of decimal places for A2 therefore = 1.04 Can this be done? Thank you for your help. Hayley . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chart Number Decimal Places | Excel Discussion (Misc queries) | |||
Split number with decimal places into 2 columns | New Users to Excel | |||
how to count the number of decimal places in a cell? | Excel Worksheet Functions | |||
Converting a number to 2 decimal places | Excel Discussion (Misc queries) | |||
Number Format Issues-Decimal Places | Excel Worksheet Functions |