Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mmc mmc is offline
external usenet poster
 
Posts: 5
Default Sequential filtering

I have 12,000 bank account numbers in sequential order in a sheet. How do I
go through the record and extract the missing account numbers?
Thanks.....

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Sequential filtering

if the bank account numbers are sequential what constitutes a missing
account number?

if it is a blank row what do mean extract?

--
Cheers
Nigel



"mmc" wrote in message
...
I have 12,000 bank account numbers in sequential order in a sheet. How do

I
go through the record and extract the missing account numbers?
Thanks.....



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sequential filtering

Assume account numbers start in column A in row 2 and are numerical.
Missing numbers will be listed in Column J

Dim j as Long, a as Long
Dim FirstNum as Long, LastNum as Long
j = 1
a = 3
FirstNum = cells(2,1)
LastNum = cells(rows.count,1).End(xlup).Value
for i = FirstNum to LastNum
if cells(a,1) = i then
a = a + 1
else
cells(j,"J").Value = i
j = j + 1
end if
Next

--
Regards,
Tom Ogilvy


"mmc" wrote in message
...
I have 12,000 bank account numbers in sequential order in a sheet. How do

I
go through the record and extract the missing account numbers?
Thanks.....



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sequential filtering

the original incorrectly listed the first number as among the missing. Here
is a correction: lightly tested.

Sub BBBB()
Dim j As Long, a As Long
Dim FirstNum As Long, LastNum As Long
j = 1
a = 3
FirstNum = Cells(2, 1)
LastNum = Cells(Rows.Count, 1).End(xlUp).Value
For i = FirstNum + 1 To LastNum
If Cells(a, 1) = i Then
a = a + 1
Else
Cells(j, "J").Value = i
j = j + 1
End If
Next

End Sub


--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Assume account numbers start in column A in row 2 and are numerical.
Missing numbers will be listed in Column J

Dim j as Long, a as Long
Dim FirstNum as Long, LastNum as Long
j = 1
a = 3
FirstNum = cells(2,1)
LastNum = cells(rows.count,1).End(xlup).Value
for i = FirstNum to LastNum
if cells(a,1) = i then
a = a + 1
else
cells(j,"J").Value = i
j = j + 1
end if
Next

--
Regards,
Tom Ogilvy


"mmc" wrote in message
...
I have 12,000 bank account numbers in sequential order in a sheet. How

do
I
go through the record and extract the missing account numbers?
Thanks.....





  #5   Report Post  
Posted to microsoft.public.excel.programming
mmc mmc is offline
external usenet poster
 
Posts: 5
Default Sequential filtering

Thanks, Tom. It works.

"Tom Ogilvy" wrote:

the original incorrectly listed the first number as among the missing. Here
is a correction: lightly tested.

Sub BBBB()
Dim j As Long, a As Long
Dim FirstNum As Long, LastNum As Long
j = 1
a = 3
FirstNum = Cells(2, 1)
LastNum = Cells(Rows.Count, 1).End(xlUp).Value
For i = FirstNum + 1 To LastNum
If Cells(a, 1) = i Then
a = a + 1
Else
Cells(j, "J").Value = i
j = j + 1
End If
Next

End Sub


--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Assume account numbers start in column A in row 2 and are numerical.
Missing numbers will be listed in Column J

Dim j as Long, a as Long
Dim FirstNum as Long, LastNum as Long
j = 1
a = 3
FirstNum = cells(2,1)
LastNum = cells(rows.count,1).End(xlup).Value
for i = FirstNum to LastNum
if cells(a,1) = i then
a = a + 1
else
cells(j,"J").Value = i
j = j + 1
end if
Next

--
Regards,
Tom Ogilvy


"mmc" wrote in message
...
I have 12,000 bank account numbers in sequential order in a sheet. How

do
I
go through the record and extract the missing account numbers?
Thanks.....






Reply
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
Sequential Numbers LiAD Excel Discussion (Misc queries) 5 January 8th 09 03:39 PM
Sequential dates. Afolabi Excel Discussion (Misc queries) 8 June 16th 06 05:48 PM
trouble filtering a list. Why isn't column filtering? Pat Excel Worksheet Functions 1 July 18th 05 03:30 PM
Non-sequential VLOOKUP function -OR- sequential sort of web query Eric S Excel Worksheet Functions 1 February 28th 05 07:50 PM
Sequential names on Sequential pages Salt4 Excel Worksheet Functions 2 November 12th 04 04:24 PM


All times are GMT +1. The time now is 06:29 PM.

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

About Us

"It's about Microsoft Excel"