Advertisement

09.14.2008 at 03:43AM PDT, ID: 23729870
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Macro to delete duplic cells, running way to slow, better method?

Asked by TylerWebD in Microsoft Excel Spreadsheet Software, Access Coding/Macros, VB Objects

Tags: , ,

OK  I have a excel document were I keep a lot of data.

I have sheet2 with all the old data (multiple columns down to row 300) and sheet1 where I dump the new data (typical col A down to row 300)

I need the macro to check sheet1 for duplicate information that is in sheet2, and if the same cell is on sheet2 it gets deleted from sheet1

I am using the code below but it takes WAY to long, even on my new computer.

*Each cell contains about 10 charaters

Any help would be appreciated.

Thanks!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Sub DelDups_TwoLists()
Dim iListCount As Integer
Dim iCtr As Integer
 
' Turn off screen updating to speed up macro.
Application.ScreenUpdating = False
 
' Get count of records to search through (list that will be deleted).
iListCount = Sheets("sheet1").Range("A1:A100").Count
 
' Loop through the "master" list.
For Each x In Sheets("Sheet2").Range("A1:E300")
   ' Loop through all records in the second list.
   For iCtr = 1 To iListCount
      ' Do comparison of next record.
      ' To specify a different column, change 1 to the column number.
      If x.Value = Sheets("Sheet1").Cells(iCtr, 1).Value Then
         ' If match is true then delete row.
         Sheets("Sheet1").Cells(iCtr, 1).Delete xlShiftUp
         ' Increment counter to account for deleted row.
         iCtr = iCtr + 1
      End If
   Next iCtr
Next
Application.ScreenUpdating = True
MsgBox "Done!"
End Sub
[+][-]09.14.2008 at 03:59AM PDT, ID: 22471830

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, Access Coding/Macros, VB Objects
Tags: Microsoft, Excel, 2007
Sign Up Now!
Solution Provided By: saurabh726
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628