Sorting by Unique Name

Justijb

New Member
Joined
Aug 16, 2016
Messages
40
Hello All,

Apologies for the multiple posts but I am in search of your expertise as my back is against the wall. I have a spreadsheet that needs to be sorted on Column D (there are column A through N) and over 18k records (rows).

Column D's header is 'Family Name'. I need to highlight in yellow the records that have only one name in it. E.g. Rows 2 and 3 only have 'Regina' while rows 4 through 23 have 'Elizabeth Lastname' and other rows have 3 or 4 words (names). I would need help developing a macro that would highlight the row that has only one word in it.

I'm not sure if this even possible because it is not specific but I figured I've received helped here before.

If any further information Is needed, please let me know.

Fingers crossed.

V/r

JB
 

63falcondude

Well-known Member
Joined
Jan 15, 2016
Messages
3,572
It sounds to me like this can be done with sorting and Conditional Formatting. Make sure that you clean your data using the trim function to make sure that there are no leading or trailing spaces (e.g. " word", " word ", and "word "). Then you can search for a space in the conditional formatting rule.
 

63falcondude

Well-known Member
Joined
Jan 15, 2016
Messages
3,572
For example, let's say that this is your data:

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="font-weight: bold;;">Family Name</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Michael</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">John Doe</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Regina</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Elizabeth Lastname</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</p><br /><br />

Now highlight A2:N5, Conditional Formatting, New Rule, Use a formula, =NOT(COUNTIF($D2,"* *")), Fill yellow, OK. This will highlight row's 2 and 4 in the above example (specifically cells A2:N2 and A4:N4).
 

Forum statistics

Threads
1,082,287
Messages
5,364,312
Members
400,789
Latest member
Gnar

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top