Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Find duplicated values in 4 columns MSHFlexgrid

Posted on 2014-01-14
4
Medium Priority
?
314 Views
Last Modified: 2014-01-19
Hi All

I would like to indicate in column (1) if i have duplicated values in column (3) - (5) - (9) - (15).

I already sort my grid:

With MSHFlexGrid1
        .Col = 3
        .Sort = flexSortGenericAscending
        .ColSel = 5
        .Sort = flexSortGenericAscending
        .ColSel = 9
        .Sort = flexSortGenericAscending
        .ColSel = 15
        .Sort = flexSortGenericAscending
        .ColSel = 46
        .Sort = flexSortGenericAscending
    End With


Now if i have duplicated values, I want to had "DUPLICATE" in the column (1)

How can i do that?

Thanks again.
0
Comment
Question by:Wilder1626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 39781265
1. Do you need to search multiple rows for the possible duplicate values or will you only need to check the values in the specified columns on the same row?

2. What is the data you are storing in these three columns?
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39781281
Hi aikimark

1. Do you need to search multiple rows for the possible duplicate values or will you only need to check the values in the specified columns on the same row?

Answer:  yes. I may have multiple rows with the same value.

Ex;

row 3
column 3 = TEST1

Column 5 = TEST2

column 9 = TEST3

column 15 = TEST4


row 15
column 3 = TEST1

Column 5 = TEST2

column 9 = TEST3

column 15 = TEST4


These 2 rows would be Duplicate since column 3 - 5 - 9 and 15 of both rows have same values.


2. What is the data you are storing in these three columns?


Answer: column 3 and 15 are all text and column 5 and 9 are numbers
0
 
LVL 46

Accepted Solution

by:
aikimark earned 2000 total points
ID: 39782949
1. change your sort code to limit the columns to those you are going to check for duplications
2. Loop through your rows, looking for duplicates, updating column 1
3. sort by col 46

========
Notes:
* determining duplicates should be relatively easy, since the values will be on adjacent rows.
* concatenate the values in the 3,5,9,15 columns and assign to a string variable.
* assign the concatenated value to a separate variable to minimize the number of concatenation operations.
* Include some delimiter character between the columnar values.
Example:
strCurrentRow = g.textmatrix(lngRow, 3) & "^" & g.textmatrix(lngRow, 5) & "^" & _ 
          g.textmatrix(lngRow, 9) & "^" & g.textmatrix(lngRow, 15)
if strPriorRow = strCurrentRow Then
       g.textmatrix(lngRow - 1, 1) = "Dup"
       g.textmatrix(lngRow, 1) = "Dup"
End If
strPriorRow = strCurrentRow 

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 39790702
Perfect thanks, i was able to follow your steps and now, it work.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question