LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Report on missing numbers

Jas,

Try some code like the following:

Sub AAA()

Dim LastRow As Long
Dim FirstRow As Long
Dim RowNdx As Long
Dim N As Long
Dim TestColumn As Long
Dim WS As Worksheet
Dim DestinationRange As Range
Dim Rng As Range

TestColumn = 1 '<<< CHANGE AS REQUIRED
FirstRow = 1 '<<< CHANGE AS REQUIRED
Set WS = Worksheets("Sheet1") '<<< CHANGE AS REQUIRED
Set DestinationRange = Worksheets("Sheet2").Range("A1") '<<< CHANGE AS
REQUIRED

With WS
LastRow = .Cells(.Rows.Count, TestColumn).End(xlUp).Row
For Each Rng In .Range(.Cells(FirstRow, TestColumn), _
.Cells(LastRow - 1, TestColumn)).Cells
If Rng.Value < Rng(2, 1).Value - 1 Then
For N = Rng.Value + 1 To Rng(2, 1).Value - 1
DestinationRange.Value = N
Set DestinationRange = DestinationRange(2, 1)
Next N
End If
Next Rng
End With

End Sub


If you actually want to insert rows or cells and fill in the missing values
of the series, see the code on
http://www.cpearson.com/excel/InsertAndFill.htm .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Jas" wrote in message
...
Hi, I receive a report of several hundred invoices that are numbered
sequentially and sometimes there are numbers that are missing in a
sequence.
Is there a way that I can run a macro and it will tell me in a different
sheet exactly what numbers are missing?

Thanks!



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report Numbers only The Rook[_2_] Excel Discussion (Misc queries) 4 August 27th 08 07:22 PM
Getting missing data from one report into another report... vlookupabyss Excel Discussion (Misc queries) 3 January 8th 08 03:26 PM
Limitation to length of Add-In description causes add-in manager to report the add-in file missing. [email protected] Excel Discussion (Misc queries) 1 February 27th 07 04:04 AM
to find missing serial numbers in randomly generated numbers B.H. Hadi Excel Worksheet Functions 2 December 1st 05 10:56 PM
Missing Report Manager help file J White Excel Discussion (Misc queries) 0 August 18th 05 09:56 PM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"