Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Coding Question

This should do the job if the range starts in cell A1:

Sub test()

Dim i As Long
Dim arr
Dim LR As Long
Dim coll As Collection

Set coll = New Collection

LR = Cells(65536, 1).End(xlUp).Row
arr = Range(Cells(1), Cells(LR, 6))

On Error Resume Next
For i = 1 To LR
coll.Add arr(i, 1), arr(i, 5) & Left$(arr(i, 6), 5)
If Err.Number < 0 Then
Cells(i, 2) = 1
Err.Clear
End If
Next i

End Sub


RBS


"Jcraig713" wrote in message
...
I have an excel spreadsheet returned from my database which, among other
data
elements, provides the following critical data:

Household Unique (hlduniq) in Column A
House Number (housenum) in Column E
Streetname (streetname) in Column F

Is it possible to write coding to return records of duplicate addresses?
What I was thinking of doing was writing something to say if house number
is
the same and the first 5 characters of streetname are the same and
household
unique is different, then return the record for resolution.

In the end, in one school building, I have over 10,000 student records to
look through to see if the street number and street name are the same and
the
household ID is different, then I have a duplciate household in my system.
Is there a way I can write code to look at my data for me and return the
records the coding finds fits my criteria so I do not have to look through
10,000 records by hand? I am an extreme novice at this so any assistance
you
can provide to help me learn how to write this type of logic would be most
appreciated. Thanks for reading this post.


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
Macro/VB coding question melExcel2007 Excel Discussion (Misc queries) 3 June 4th 10 11:16 PM
VBA Coding Question Matt Excel Programming 3 January 30th 08 12:03 PM
Coding question bach Excel Programming 4 September 19th 05 08:59 PM
Coding best practice question Mark Stephens Excel Programming 2 May 10th 05 04:48 PM
coding question No Name Excel Programming 1 September 28th 04 05:26 PM


All times are GMT +1. The time now is 09:00 AM.

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"