If CellAddr.Row = 0 Or CellAddr.Column > 1 Then Exit Subĭim FirstNameCell, LastNameCell, FullNameCell As ObjectįirstNameCell = Sheet.getCellByPosition(0, CellAddr.Row) ' W eonly car about changes in the First or Last name columns If Not ChangedRange.supportsService(".SheetCell") Thenĭim ChangedRows() : ChangedRows() = ChangedRange.getDataArray()ĭim FirstChangedRow() : FirstChangedRow() = LBound(ChangedRows())ĬellAddr = ChangedRange.getCellByPosition(0, 0).getCellAddress() ' CellAddr is to be the first cell in the ChangedRange MsgBox "Column D must be ""Intermediate helper for duplicate detection"" for duplicate detection." If Sheet.getCellByPosition(FullNameColumnIndex, 0).String "Détection doublons" Then MsgBox "Column B must be ""Last Name"" for duplicate detection." If Sheet.getCellByPosition(LastNameColumnIndex, 0).String "NOM" Then MsgBox "Column A must be ""First Name"" for duplicate detection." If Sheet.getCellByPosition(FirstNameColumnIndex, 0).String "Prénom" Then ' Raise the number below if we ever reach it ' It needs First, Last and Full name columns to be where they belong ' Duplicate detection code is ran at each content change Global MaxRowIndexForDuplicateSearch As Integer If you see horrible things in the code below, please do tell me!Ĭode: Select all Global FirstNameColumnIndex, LastNameColumnIndex, FullNameColumnIndex As Integer I'm a former C++ programmer but know next to nothing about good programming in Basic. If they decide it's not the same person, they just have to come back to the line they just filled. Then I check if I find a duplicate, and if so, a Message Box tells the user there might already be an entry for this name, and takes them there. On changed content, I fill the intermediate column with a normalized full name so it's only done once and for all. On opening the file, I check that the columns I need are in place, in case someone else messed with the file. Thanks anyway, it could be an important improvement. But with the skills and time at hand, it's not something I suppose we could tackle right now. Our Calc sheet also has a history of subscriptions dates and fees, which could benefit from a database. ![]() But sometimes we don't know, and I changed the solution accordingly. ![]() They can write down their e-mail address, which also helps. They come and subscribe to a workshop we offer, so sometimes we have knowledge outside of the Calc sheet to determine this. About handling people with the same name:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |