loop

watkins6878

Board Regular
Joined
Nov 26, 2005
Messages
96
Hi I am using this code to loop through my worksheet but whilst looping through Column A i need to check column B for duplicate Names and also column C for either "DEL" OR "E+R" could someone please point me in the right direction
Code:
Private Sub OverDue_Click()
 
Dim iDate As Range
Dim strDate As Date

strDate = Date
 
  For Each iDate In Range("A:A")
        
     If iDate > 0 And iDate < strDate - 30 Then
         iDate.EntireRow.Select
               
         With Selection.Interior
           .ColorIndex = 5
           .Pattern = xlSolid
         End With
    
     ElseIf iDate > 0 And iDate < strDate - 7 And iDate > _
       strDate - 30 Then
             iDate.EntireRow.Select
             
             With Selection.Interior
                 .ColorIndex = 3
                 .Pattern = xlSolid
             End With
           
     ElseIf iDate > 0 And iDate > strDate - 7 Then
             iDate.EntireRow.Select
        
             With Selection.Interior
                 .ColorIndex = xlNone
                
             End With
     End If
        
 Next iDate


End Sub

Thanks in advance

Alan
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi Alan

Can you provide examples of what you might encounter and the result of the macro you want to achieve? Thanks.

Best regards

Richard
 
Upvote 0
HI RichardSchollar
GP SKIP.xls
ABCDEFGHIJ
1Today'sDate>>>>>>>>12/10/200604/10/2006
2DATENAMETYPEHOUSENO:HOUSENAMEADDRESSTOWNPERMITPERMITSTARTPERMITEXPIRE
301/09/2006AlanDELFreeStreet
401/09/2006DavidDELChesterRd
516/09/2006AlanE+RFreeStreet
616/09/2006JimDELsilverstreet
724/09/2006DavidE+RChesterRd
809/10/2006DavidE+RChesterRd
912/10/2006deborahDELinkermanRoad
10
1130+daysLate
12Between7&30dayslate
13OK
14
15
16
17
18
Skips


So if you look at david he has had the same skip for over a month But it has been emptied and taken back so i need the code to ignore the first 2 entries and just check that the last entire for david is not older than 7 days. To do this i would like to check for duplicate addresses and then look to see if the skip is E+R or E+O or DEL if it is E+O it needs to be ignore alltogether

Sorry if this makes no sense

Thanks for looking

Alan
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,245
Members
448,952
Latest member
kjurney

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top