ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with macros (https://www.excelbanter.com/excel-programming/402622-problem-macros.html)

[email protected]

Problem with macros
 
Can someone help me with this problem? The task is something like
this. In one row we have some codes, like a,a,a, b, c, c, d, e, e, e.
In another row I have to mark them so that every code that is unique
has number 1 next to it, and the one that is repeating must have
numbers from 1 to something, depends on the number of repeatings. So
in my case it would look lik this.
1st row 2nd row
a 1
a 2
a 3
b 1
c 1
c 2
d 1
e 1
e 2
e 3
Can please someone make me a macro for this? Thanks,

Snake Plissken[_2_]

Problem with macros
 
you dont need a macro in fact...
here is the situation:

header(A1) counter(B1)
a =IF(A2<A1;1;1+B1)
a copy formula seen above
etc



[email protected]

Problem with macros
 
On 12 pro, 09:56, "Snake Plissken"
wrote:
you dont need a macro in fact...
here is the situation:

header(A1) counter(B1)
a =IF(A2<A1;1;1+B1)
a copy formula seen above
etc


It works! Thank you!

Bob Phillips

Problem with macros
 
B1: =COUNTIF(A:A,A1)

and copy down

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Snake Plissken" wrote in message
...
you dont need a macro in fact...
here is the situation:

header(A1) counter(B1)
a =IF(A2<A1;1;1+B1)
a copy formula seen above
etc





Snake Plissken[_2_]

Problem with macros
 
no problem - of course data stored in first column has to be sorted with
ascendindg or descending mode before copying the formula, and everything can
be done by macro, however task is simple so we can "avoid" a macro ;)



Rick Rothstein \(MVP - VB\)

Problem with macros
 
A slight modification to your formula in order to produce the numbers the OP
asked for originally...

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

...and copy down

Rick


"Bob Phillips" wrote in message
...
B1: =COUNTIF(A:A,A1)

and copy down

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Snake Plissken" wrote in message
...
you dont need a macro in fact...
here is the situation:

header(A1) counter(B1)
a =IF(A2<A1;1;1+B1)
a copy formula seen above
etc







All times are GMT +1. The time now is 07:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com