View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Distributing cell value (not text-to-columns)

On Tue, 16 Jul 2013 02:44:11 +0100, gregbowey wrote:


Thank you so much for your work here. It is very much appreciated! I
have one last tweak that I would like to know if it's possible. In the
original query, I asked that a remainder be shown i.e. 0.5, 0.5, 0.5,
0.23. Is it possible to get the macro to spit the last one out as a 0.5
as well (rather than the exact remainder)?


I suspect the algorithm would have been much simpler had that requirement been made known at the beginning, but the present algorithm will work with just a minor change:

====================
....
Case 6
If d dLotSize Then
vRes(k, j) = dLotSize
Else
vRes(k, j) = dLotSize
End If
d = d - dLotSize
....
=====================================