Sequence Numbers (1 Viewer)

friendly

Registered User.
Local time
Today, 18:34
Joined
Sep 19, 2013
Messages
19
There are occasions, especially with survey data, when you need to create an enumeration (also called a counting or identification) variable that starts at one for each group in your data.

For example:(Attach Files)

Thanks for your help
 

Attachments

  • Untitled2.png
    Untitled2.png
    56 KB · Views: 88

friendly

Registered User.
Local time
Today, 18:34
Joined
Sep 19, 2013
Messages
19
I would like to make VBA to get Sequence Numbers
like example
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:34
Joined
Feb 28, 2001
Messages
27,182
Do the sequence numbers have anything to do with the data set itself, or are they just present to allow you to specify a line when discussing data with others?

Are the sequence numbers supposed to be permanent (i.e. fixed in value when stored and can never be updated) or volatile (i.e. fixed in value when displayed, and can change if displayed in another order or with different filtration)?

Without at least THAT much information, your answer will be multi-valued. Not to mention, it wouldn't hurt to specify the column you want to use in your question. Is it the right-most column with the red line under the header or the left-most column with a compound numbering scheme that is data dependent?

We are willing to help but we need a bit more to work with than you have given.
 

friendly

Registered User.
Local time
Today, 18:34
Joined
Sep 19, 2013
Messages
19
they just present to allow you to specify a line when discussing data with others
the are sequence numbers supposed to be permanent

thanks
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:34
Joined
Feb 28, 2001
Messages
27,182
A couple of more questions: If the sequence numbers are permanent, they need to be part of the record. Do the numbers have to be contiguous among the entire set of reecords or can you have gaps? (If you had a selective display and permanent numbers for each record, there would be gaps anyway.)

Are you familiar with the "autonumber" concept? If not, read up on that online (including many articles in this forum). If that will do what you want, VBA never enters the picture. However, autonumbers can have gaps so if the number MUST be contiguous, another solution will be required.

The reason I'm asking these questions is because the required properties of your number are clearly the crux of your question but they are not clearly enough described for us to know how best to answer.
 

AlexN

Registered User.
Local time
Today, 18:34
Joined
Nov 10, 2014
Messages
302
Any idea please

I'm afraid you got to have a set of rules for these sequence numbers and I don't see you mention it somewhere.
So let me try to clarify it.

  • You want them to be autoincreasing but have a standard prefix depending on customer's sex.
  • You want them to start from the beginning when date changes
  • They are no primary key or something like that so there can be duplicates.
  • Second part of the numbers has to have 4 digits, at least the rightmost of them not being zero.

Are these rules necessary and sufficient in math terms?

Doc sorry for the intrusion
 

friendly

Registered User.
Local time
Today, 18:34
Joined
Sep 19, 2013
Messages
19
I'm afraid you got to have a set of rules for these sequence numbers and I don't see you mention it somewhere.
So let me try to clarify it.

  • You want them to be autoincreasing but have a standard prefix depending on customer's sex. Yes
  • You want them to start from the beginning when date changes Yes
  • They are no primary key or something like that so there can be duplicates. Yes
  • Second part of the numbers has to have 4 digits, at least the rightmost of them not being zero. Yes

Are these rules necessary and sufficient in math terms?

Doc sorry for the intrusion


I extend my sincere thanks and appreciation to help me
 

Users who are viewing this thread

Top Bottom