VBA: Make Copies based on the number with largest decimal no.s.

panyagak

Board Regular
Joined
Feb 24, 2017
Messages
236
Hi Mrexcel Experts

Am wondering how to go about this last problem, the VBA WAY, currently facing me in my Numerical Analysis.

My data starts on Cell A2 and ends on Cell U..eg. A2:U11200, A2:U17000 etc.
Row 1 is Header.

In my bid to further ensure "exactitude" of data due to "round-off errors", I need to use up ALL digits after 2 d.p to the last d.p excluding the last zeroes.

NOTE: HAVE STANDARDISED ALL NO.S TO 1., 2., 3., ETC FOR SIMPLICITY.

First, the code to identify the value within the row (from Columns N,P,R,S,T,U) with the longest digits & count the digits AFTER THE 2 d.p. UP TO THE START OF UNENDING ZEROES (Eg. - 1.18338760000 - If 5, THEN make 5 row copies downwards - to ensure 3 to 5 d.ps are all captured AS IN 1.18, 1.183, 1.1833, 1.18339, 1.183388 & 1.1833876.
IGNORE DUPLICATES & ZEROES FOR THE OTHER NUMBERS!

The first copy begins with 2 decimal places rounded-off, then 3,4,5 to last d.p.

Eg. 1 Columns N,P,R,S,T,U
9 Extra Copies needed downwards. (Based on Col. R)
N. 1.18338760000
P. 3.867670000
R. 1.516447368420000
S. 5.33356560000
T. 1.58675680000
U. 2.1033780000

Eg. 2 Columns N,P,R,S,T,U
12 Extra Copies needed downwards. (Based on Col. U)
N. 1.183340000
P. 3.867560000
R. 2.1033550000
S. 5.33397660000
T. 1.58675780000
U. 1.454545454545450000

Kindly help out. (ALTERNATIVE APPROACHES ARE WELCOME).
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,259
Messages
5,510,143
Members
408,777
Latest member
LSlisher11

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top