Code To List Numbers Missing From Sequence

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,449
Office Version
365
Platform
Windows
What else can I say!!
You could tell us
- which of the two codes produced the error?
- is my assumption correct?
- do you get that error with all data samples or only one/some?
- do you get that error with the small sample data shown in post #1
- if the data producing the error is other than the sample data, tell us about the size & nature of that data.

If we can't reproduce the error, what else can we say other than that we don't get that error?
 

Some videos you may like

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,396
Office Version
2016
Platform
Windows
I think I have found the problem. Not all the data has 4 numbers like my example. There are ones with 3 i.e SS010, SS200. When I run the code with the same as my example it worked fine. Sorry my fault. Can the code accommodate any amount of numbers after the prefix please?
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,449
Office Version
365
Platform
Windows
There are ones with 3 i.e SS010, SS200.
In any one file, are all the items of data the same number of characters? That is, could you have SS010 (3 digits) and SS9876 (4 digits) in the same file?
 

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,396
Office Version
2016
Platform
Windows
Any more thoughts please?
 

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
3,941
Could we have a different number of prefix letters on the same list?
 

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,396
Office Version
2016
Platform
Windows
9 times out of 10 the prefix letters would be the same.
 

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,396
Office Version
2016
Platform
Windows
If it makes it easier I can try to make the files with all the same prefix and and the same amount of digits after, although may be a little tricky.
 

Watch MrExcel Video

Forum statistics

Threads
1,095,971
Messages
5,447,619
Members
405,458
Latest member
newbie111

This Week's Hot Topics

Top