Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie pivot table question (using match to find a value) Keith R Excel Discussion (Misc queries) 1 May 1st 07 03:38 PM
How can I find the greatest possible sum within 12 months? A newbie... [email protected] Excel Worksheet Functions 17 October 1st 06 11:49 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
Newbie. Please help me find a loop solution Nigel Brown[_3_] Excel Programming 1 July 16th 03 02:48 PM
Newbie. Please help me find a loop solution Nigel Brown[_2_] Excel Programming 0 July 16th 03 10:25 AM


All times are GMT +1. The time now is 07:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"