Code To List Numbers Missing From Sequence

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,205
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?
 

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,377
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
42,205
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,377
Any more thoughts please?
 

Worf

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

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,377
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.
 

Forum statistics

Threads
1,081,615
Messages
5,360,037
Members
400,565
Latest member
Tommy O

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top