View Single Post
  #43   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Align cells with same value - vba almost working

Clif McIrvin has brought this to us :
"GS" wrote in message
...
Clif McIrvin submitted this idea :
In Rick's code, he copies Col B below A, then sorts ...


Yes, I know. I added the sort to colB in case the data was not contiguous.
(As is the case after the code is run, then re-run)



Actually, Rick's code handled that just fine as posted ... I accidentally did
that while testing ... then studied his code some more to see why it didn't
fail <g. His .copy didn't care that there was dis-contiguous data, and after
he sorted the result the data was all contiguous again.


This is only the case for colA. After the code runs, colB is no longer
contiguous and so re-running the code puts the empty cells into the
array, making the process longer than necessary. I put the line to sort
so this didn't happen.<g

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc