LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Using AND to eliminate IF statements

When the final data is all assembled, there are duplicates that need to be
eliminated, but entries in a certain column from the duplicates need to be
combined and left in that column for the final unique entry.

I use this to do that:

For Row = totalrows To 6 Step -1
If Cells(Row, nameCol).Value = Cells(Row - 1, nameCol).Value Then
If Cells(Row, streetNumCol).Value = Cells(Row - 1,
streetNumCol).Value Then
If Cells(Row, StreetNameCol).Value = Cells(Row - 1,
StreetNameCol).Value Then
If Cells(Row, unitNumCol).Value = Cells(Row - 1,
unitNumCol).Value Then
If Cells(Row, ServLevelCol).Value < Empty Then
Cells(Row - 1, ServLevel).Value = _
Cells(Row - 1, ServLevel).Value & _
"/" & Cells(Row, ServLevel).Value
End If
Rows(Row).Delete
count = count + 1
End If
End If
End If
End If
Next Row

With over 8000 rows, this takes a little time and I was wondering if an AND
construct would be faster.

I just don't know the syntax to combined those first 4 IF statements using
AND.

Was also wondering if there weren't a more elegant way to do this.

Thanks for any suggestions.

Ken Loomis



 
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
How to eliminate 0's Dani B Excel Discussion (Misc queries) 3 December 18th 08 04:20 PM
eliminate zero S S Excel Worksheet Functions 5 February 10th 07 09:24 AM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
Can I eliminate pop up clipboard? bunny Excel Discussion (Misc queries) 2 May 11th 06 08:10 PM
How to eliminate #REF pat59 Excel Discussion (Misc queries) 2 March 2nd 06 10:40 AM


All times are GMT +1. The time now is 12:02 AM.

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

About Us

"It's about Microsoft Excel"