Excel Sorting

Justijb

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

I can't believe the response and how helpful everyone was last time. Hopefully I can get the same results this time around. Okay - I have a spreadsheet with multiple columns (A through N). How would one go about writing the macro to sort on column D where row 1 is "family name" and I would need to highlight yellow every row that has only one name in it.

E.g.

Rows two and three have 'regina" and nothing else while rows 4-23 has "Elizabeth lastname" and other rows have three names in it.

Is there any way to codify this action by space between words. I'm thinking this is the only way since every name is unique and multiple rows have the same name sometimes?

If further information is needed, please let me know.

Thanks.

V/r


JB
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
A conditional formatting would probably be the best and easiest way:
Select the range (D:D) to format.
Go to "Conditional formatting" -> "New Rule..." -> "Use a formula to determine which cell to format"
In the TextBox ("Format values where this formula is true:") put this formula in: "=ISERROR(FIND(" ",$A1))"
Push the "Format..." button
"Fill" -tab -> choose color (in your case, yellow)
"Ok" -> "Ok"

Now, if a cell in above range doesn't have a space (" ") in it, this cell will be colored with the color chosen from the "Fill" -tab...
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,507
Messages
6,131,059
Members
449,616
Latest member
PsychoCube

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top