PDA

View Full Version : [SOLVED:] add lines



karlux_lip
10-22-2021, 08:14 AM
hello guys,


I need to automatically add lines through a VBA code.
What I need is this:
If you have only one number, add the line "1" in front of number, if have 2 equal number, then add the lines "1" and "2".
Example:



500
1


501
1


501
2


501
3


502
1


503
1


503
2


504
1


505
1


505
2




Can you help me?

Thanks...

Paul_Hossler
10-22-2021, 09:18 AM
In B1 and fill down



=COUNTIF($A$1:A1,A1)


29080

karlux_lip
10-25-2021, 01:42 AM
It's not work for me.

Mine is in portuguese, but it's the same.


29090

karlux_lip
10-26-2021, 04:00 AM
SOLVED

=CONTAR.SE($B$2:B2;B2)

Aussiebear
10-26-2021, 05:38 AM
Not sure how you arrived at that solution given that you are attempting to count the recurring values in Column A. The only mistake that I see in the example you posted is that you got the punctuation marks mixed up, other wise it should have worked.