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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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