Hi, Is there a subroutine out here that will allow me to use the find command to locate multiple occurences of a Name in a column, but then expand the selection to the entire row(s) so I can delete them en masse? Also, I’d like to use the same concept to find a name(s) in a column, but select all the entire record(s) so I can color-code them.
OR, better yet, is this a function in Excel and I just don’t know how to use it? Thanks for your help. Lana
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
fine name in column, delete entire record (Excel 2003 Win XP)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » fine name in column, delete entire record (Excel 2003 Win XP)
- This topic has 14 replies, 4 voices, and was last updated 16 years, 7 months ago.
AuthorTopicWSlana
AskWoody LoungerNovember 10, 2008 at 2:27 pm #455196Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody LoungerNovember 10, 2008 at 6:10 pm #1132018See if the threads starting at post 562,687 or post 590,834 help. You can also search this forum for delete duplicate for other relevant threads.
-
WSlana
AskWoody LoungerNovember 10, 2008 at 10:51 pm #1132031Hi Hans, thanks for the tip. I was hoping you’d still be out there. I have copied the routines in those posts you suggested, but am a bit confused by them. I will try them when I get to work this morning. I’m not much interested in messing with duplicates, just want to do a find, then expand the selections found to the entire record. There is one here regarding color coding that I will try first and if that works perhaps I can amend it to include a delete command. I’ll let you know.
Lana
P.S. When I tried to edit this message it was overwriting rather than inserting, do you know how I can change that?
-
WSmikerickson
AskWoody LoungerNovember 11, 2008 at 3:10 am #1132052The attached routine will delete duplicated rows without looping. There are options for
delete all duplicated rows (Sam, Dave, Mary, Sam, John, Dave >> Mary, John)
keep first duplicated row, delete the rest (Sam, Dave, Mary, Sam, John, Dave >> Sam, Dave, Mary, John)
Delete all rows that match the name the user inputs
Keet the first row of the user input name, delete the other occurances.For mass coloring, you could use Condiditonal Formatting.
-
WSlana
AskWoody LoungerNovember 11, 2008 at 1:29 pm #1132216Hi Mike,
Would you believe this help site is blocked at my work! So I am just getting home and took a look at these commands. I will try them at work tomorrow. I do have something working, but don’t quite know how I got there. Started with the delete dups coding Hans pointed me to and edited and tweaked ’til it worked. Odd thing is when I try to record a macro that does a find on something, then I select all those occurrences, and do a delete – entire row, it works beautifully, but the find command doesn’t record so I can’t embed it in my macro – I think that’s odd. Hope yours work for me. Thanks for responding.
-
WSlana
AskWoody LoungerNovember 12, 2008 at 10:21 am #1132420Hi Mike and Hans,
Well, I had a big long message to post and the web page timed out. Good grief. At any rate, I have a pretty decent (although admittedly unsophisticated) macro recorded/coded to generate the report I need. However, I feel that I am still doing more manually than I need to. First, when I open the master file I immediately do a save as (I save it as the same title each time to make it easy) and then I have to respond to the ‘yes’ or ‘no’ do you want to overwrite the existing file question. How do I do that automatically?
Then, odd thing, when I do a sort, first on column H, then column A, it works beautifully. When I embed it into a macro I get error message 1004 – ‘This operation requires the merged cells to be identically sized.’ Well, to my knowledge I only have 3 cells merged and I particularly changed them today to be the same width. After I got home I thought maybe they mean vertically, although it would be weird and accidental if they weren’t the same height. Any way to correct that with code or at least to find the culprit? Funny it works immediately when I do it from the keyboard.
When the report is complete I would like to tell it to go to the last populated cell and do a Ctrl Shift Home to select all of the data, then do a set print. Can I then do a save, close both the macro and excel, or is that not possible from within the macro?
Not done yet, since I earlier find all of the names I don’t need and change them to abc, it seems silly that I then have to tell it to delete rows where it encounters abc (in response to the user input command).? Can’t I just embed that within the macro somehow? That would eliminate that manual step as well.
If these are easy fixes, please let me know. If not, that’s fine, I can certainly go with what I have and still create my report in a few minutes. Thanks for all your help. -
WSHansV
AskWoody LoungerNovember 12, 2008 at 11:10 am #1132423Our server is being backed up every day between 23:00 and 01:00 UTC, and Woody’s Lounge is extremely slow for much of that time – sorry about that.
You can suppress warnings such as the overwrite warning by inserting a line
Application.DisplayAlerts = False
above the code that generates the warning. If you want to display the warnings again, use
Application.DisplayAlerts = True
Sorting a range with merged cells is problematic. I would avoid merged cells if possible.
To get the range from the first used cell to the last used cell, you can use ActiveSheet.UsedRange. If you want to print this range, you can use ActiveSheet.UsedRange.PrintOut.
To save the active workbook: ActiveWorkbook.Save.
To quit Excel (and hence end macro execution): Application.Quit.
-
WSlana
AskWoody LoungerNovember 12, 2008 at 12:22 pm #1132442Thanks Hans, I will add those fixes tomorrow. I really hate it that this site is blocked at work, it makes it very inefficient for getting help in a timely manner. BTW, that merged cells deal, the two columns in my file (H) and (A) are neither ones that contain merged cells. Should that matter, or is it affected by merged cells anywhere in the worksheet?
Lana
-
WSHansV
AskWoody Lounger -
WSlana
AskWoody Lounger -
Don Wells
AskWoody LoungerNovember 12, 2008 at 2:20 pm #1132461Some time back Hans enlightened me about the following alternative to horizontally merged cells.
- Place data in the leftmost cell
- Select the range that should appear merged
- Pull down: Format > Cells (Ctrl +1)
- Select the Alignment tab
- Pull down: Horizontal > Center Across Selection
[/list]
-
-
-
WSmikerickson
AskWoody LoungerNovember 12, 2008 at 3:37 pm #1132465There are four functions in that routine.
If none of them works for you, the idea is to concoct a string (formulaString) such that the formulaspareColumn.FormulaR1C1 = "=1/(1-(" & formulaString & ")"
will return an error value for those rows that you want deleted.
Merged cells get in the way of so many procedures that I prefer CenterAcrossSelection, when possible.
-
WSlana
AskWoody LoungerNovember 12, 2008 at 5:20 pm #1132469I was going to try that center across selection tomorrow – nice to know that it will work. Also, Mike the routine you provided that asks for user input works just fine for me, that’s what I am currently using. But since I just have the one string to find and delete (abc), I thought I could do it automatically rather than with user input. I’ll see if I can tweak it tomorrow as well. Thanks to all of you.
-
WSlana
AskWoody LoungerNovember 13, 2008 at 9:54 am #1132606Well, all, you’ve done it again. I now have a working macro that I run by clicking an icon on the toolbar. How neat is that? Hans, all of those quick little commands you gave me worked great, even the one that selects just the records with data – I was leery of that, but it works just fine. I’ll have to keep that in mind. As well, Don, that Center Across Selection is great, too, I must remember that! And Mike, kudos to you as well, all I had to do was replace the words UserString (or whatever) with “abc” and the macros works fine with no input from me – wonder why I couldn’t have figured that out yesterday. At any rate, this ends the thread – I am content. Thanks much.
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Microsoft : Edge is better than Chrome
by
Alex5723
4 hours, 21 minutes ago -
The EU launched DNS4EU
by
Alex5723
9 hours, 54 minutes ago -
Cell Phone vs. Traditional Touchtone Phone over POTS
by
280park
15 minutes ago -
Lost access to all my networked drives (shares) listed in My Computer
by
lwerman
15 hours, 21 minutes ago -
Set default size for pasted photo to word
by
Cyn
21 hours, 23 minutes ago -
Dedoimedo tries 24H2…
by
Cybertooth
9 hours, 29 minutes ago -
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
1 day, 20 hours ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
1 day, 17 hours ago -
Small desktops
by
Susan Bradley
11 hours, 1 minute ago -
Totally disable Bitlocker
by
CWBillow
13 hours, 54 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
1 day, 17 hours ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
3 days ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
19 hours, 3 minutes ago -
Mystical Desktop
by
CWBillow
3 days, 3 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
2 days, 8 hours ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
1 day ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
3 days, 18 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
3 days, 21 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
3 days, 19 hours ago -
What is wrong with simple approach?
by
WSSpoke36
1 day, 17 hours ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
4 days, 7 hours ago -
Location, location, location
by
Susan Bradley
2 days, 21 hours ago -
Cannot get a task to run a restore point
by
CWBillow
4 days, 8 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
3 days, 23 hours ago -
June 2025 Office non-Security Updates
by
PKCano
4 days, 19 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
8 hours, 9 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
4 days, 19 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
5 days, 5 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
4 days, 8 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
5 days, 14 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.