Correct string

juneau730

Board Regular
Joined
Jun 7, 2018
Messages
111
Hi again,

The scripts I had working have evolved due to the change in data sets. I was able to get the majority of them tweaked and working except for one area. In the code snippet below, in Cell 'S" as part of the macro, I need it to filter on specific word strings (either ignoring or finding specific info) within the cells (.Range("S2:S7500")

I tried to record a Macro filtering on the cells, but it errors out due to the amount of data. Not sure if this is an unsolvable issue, but though I would ask.

Code:
If .Cells(i, "S") = "OU=Service" Then                .Rows(i).Copy sh7.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
            If .Cells(i, "S") = "OU=Service" AND  .Cells(i, "L") >= 365 Then
                .Rows(i).Copy sh9.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
            If .Cells(i, "S") = "OU=Service" AND .Cells(i, "M") >= 1095 Then
                .Rows(i).Copy sh10.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
            If .Cells(i, "S") = "OU=Service" AND .Cells(i, "M") >= 1065 Then
                .Rows(i).Copy sh11.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
            If .Cells(i, "S") = "OU=Service" AND .Cells(i, "C") <"SERVICE ACCOUNT"> Then
                .Rows(i).Copy sh12.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
            If .Cells(i, "S") <"OU=Service"> AND .Cells(i, "S") <"OU=Service"> Then
                .Rows(i).Copy sh13.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
            If .Cells(i, "S") <"OU=Service"> AND .Cells(i, "C") = "Service Account" Then
                .Rows(i).Copy sh14.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
            If .Cells(i, "S") <"OU=Users"> AND .Cells(i, "I") = <= 31 Then
                .Rows(i).Copy sh15.Cells(Rows.Count, 1).End(xlUp)(2)
            End If
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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