ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check for missing invoice numbers (https://www.excelbanter.com/excel-programming/333254-check-missing-invoice-numbers.html)

luxboy

Check for missing invoice numbers
 

Hi All,

Firstly thanks for taking the time to look at this post.

The problem I have is relating to invoices. I have an Excel spreadshee
which I write down all payments I make for invoices. The invoice number
are always a number and started at 1 and then increment by 1. IE 1, 2,
etc.

What I would like to do is to have a way in which I could look in m
sheet to see if I have any invoices missing. ie 6 and 8 is there but
is not.

Due to the nature of invoices they are not always in order so I migh
pay 9 before I pay 8 and therefore on my spreadsheet they wont be i
order. they are currently in order of when I paid them.

Would anyone know a way I could do this?

Many tnaks agai

--
luxbo
-----------------------------------------------------------------------
luxboy's Profile: http://www.excelforum.com/member.php...fo&userid=2478
View this thread: http://www.excelforum.com/showthread.php?threadid=38345


Bob Phillips[_7_]

Check for missing invoice numbers
 
Could you not just have a list of functions say starting in M1

=IF(ISNUMBER(MATCH(ROW(M1,$C$!:$C$1000,0))),"",ROW (M1)&" is missing")

and just copy down. Not particularly sophisticated, but should work.

--
HTH

Bob Phillips

"luxboy" wrote in
message ...

Hi All,

Firstly thanks for taking the time to look at this post.

The problem I have is relating to invoices. I have an Excel spreadsheet
which I write down all payments I make for invoices. The invoice numbers
are always a number and started at 1 and then increment by 1. IE 1, 2,3
etc.

What I would like to do is to have a way in which I could look in my
sheet to see if I have any invoices missing. ie 6 and 8 is there but 7
is not.

Due to the nature of invoices they are not always in order so I might
pay 9 before I pay 8 and therefore on my spreadsheet they wont be in
order. they are currently in order of when I paid them.

Would anyone know a way I could do this?

Many tnaks again


--
luxboy
------------------------------------------------------------------------
luxboy's Profile:

http://www.excelforum.com/member.php...o&userid=24781
View this thread: http://www.excelforum.com/showthread...hreadid=383450




keepITcool

Check for missing invoice numbers
 

could do it like following:

i'm sure there must be faster ways,(with sorting etc)
but this was nice and easy

copy/paste the code to a normal module.
select the range with the invoices
and fire it up..

and emm... it will check for non unique numbers too!

Sub CheckNumbers()
'needs a reference to "Microsoft Scripting Runtime"
'set via VBE Tools/References
Dim dicNrs As Scripting.Dictionary
Dim dicMis As Scripting.Dictionary
Dim dicDbl As Scripting.Dictionary
Dim rng As Range
Dim n&, nMin&, nMax&

Set dicNrs = New Dictionary
Set dicDbl = New Dictionary
Set dicMis = New Dictionary

For Each rng In ActiveWindow.RangeSelection.Cells
If Not IsEmpty(rng) Then
If dicNrs.exists(rng.Value) Then
dicDbl.Add rng.Address(0, 0), rng.Value
Else
dicNrs.Add rng.Value, Null
End If
End If
Next
nMin = Application.Min(dicNrs.Keys)
nMax = Application.Max(dicNrs.Keys)

For n = nMin To nMax
If Not dicNrs.exists(n) Then dicMis.Add n, Null
Next

If dicMis.Count = 0 Then
MsgBox "no missing"
Else
Set rng = Application.InputBox( _
dicMis.Count & " numbers missing" & vbLf & _
"select a vertical range to show them.", Type:=8)
rng.Cells(1) = "missing numbers"
rng.Cells(2).Resize(dicMis.Count) = Application.Transpose( _
dicMis.Keys)
End If

If dicDbl.Count 0 Then
Set rng = Application.InputBox( _
dicDbl.Count & " numbers double" & vbLf & _
"select a vertical range to show them.", Type:=8)
rng.Cells(1) = "double Numbers"
rng.Cells(2, _
1).Resize(dicDbl.Count) = Application.Transpose(dicDbl.Keys)
rng.Cells(2, _
2).Resize(dicDbl.Count) = Application.Transpose( _
dicDbl.items)
End If

End Sub





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


luxboy wrote :


Hi All,

Firstly thanks for taking the time to look at this post.

The problem I have is relating to invoices. I have an Excel
spreadsheet which I write down all payments I make for invoices. The
invoice numbers are always a number and started at 1 and then
increment by 1. IE 1, 2,3 etc.

What I would like to do is to have a way in which I could look in my
sheet to see if I have any invoices missing. ie 6 and 8 is there but 7
is not.

Due to the nature of invoices they are not always in order so I might
pay 9 before I pay 8 and therefore on my spreadsheet they wont be in
order. they are currently in order of when I paid them.

Would anyone know a way I could do this?

Many tnaks again


luxboy[_2_]

Check for missing invoice numbers
 

Perfect!


Works like a charm

Many thanks indee

--
luxbo
-----------------------------------------------------------------------
luxboy's Profile: http://www.excelforum.com/member.php...fo&userid=2478
View this thread: http://www.excelforum.com/showthread.php?threadid=38345



All times are GMT +1. The time now is 06:01 AM.

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