Code To List Numbers Missing From Sequence

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,401
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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

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,401
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,938
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,158
Messages
5,442,728
Members
405,194
Latest member
Aprivate

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top