Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie : Find / Find Next
I am using Excel 97.
I need to complish the following. I have a list of account numbers that need to be deleted from a spreadsheet. The problem is that I don't know how many instances of the account number is on the spreadsheet, so I need to issue the find command again and again until all account nubmers have been deleted. So the code might look like 1. get account number 2. find it on spreadsheet. 3. if found, delete that row. 4. continue until all instances of the account number are deleted. 5. go get next account number. My question to you is, what is the best way to tell Excel to continue looking for these values until all of them have been deleted. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie : Find / Find Next
How about something like:
Set rng1=Range("deletable_number_list") Set rng2 =Range("spreadsheet_account_number_list") For Each iCell in rng2 If Application.Countif(iCell.value,rng1)0 then _ iCell.EntireRow.Delete Next iCell Alan Beban Rich wrote: I am using Excel 97. I need to complish the following. I have a list of account numbers that need to be deleted from a spreadsheet. The problem is that I don't know how many instances of the account number is on the spreadsheet, so I need to issue the find command again and again until all account nubmers have been deleted. So the code might look like 1. get account number 2. find it on spreadsheet. 3. if found, delete that row. 4. continue until all instances of the account number are deleted. 5. go get next account number. My question to you is, what is the best way to tell Excel to continue looking for these values until all of them have been deleted. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
newbie pivot table question (using match to find a value) | Excel Discussion (Misc queries) | |||
How can I find the greatest possible sum within 12 months? A newbie... | Excel Worksheet Functions | |||
Despite data existing in Excel 2002 spreadsheet Find doesn't find | Excel Discussion (Misc queries) | |||
Newbie. Please help me find a loop solution | Excel Programming | |||
Newbie. Please help me find a loop solution | Excel Programming |