applying trapped filter

littlepete

Active Member
Joined
Mar 26, 2015
Messages
489
Office Version
  1. 365
Platform
  1. Windows
hello :)

in my column A i have a string that shows the division of my data... it looks like:
1.
...
4.15.3.5
...
135.25.2.5.1

if i filter that last line, i also would like to see 135 ; 135.25 ; 135.25.2 and 135.2.5

i think the best way is with a help column to put a mark (x) and i do succeed to filter the first 135
but i'm stuck in the other levels ...

this is part of what i have :

level1 = Left(currdivision, WorksheetFunction.Find(".", currdivision) - 1)
leftover = InStr(1, nextlevel, ".")
nextlevel = Right(currdivision, Len(currdivision) - leftover)

(all values are strings)

what's your advice :) ?

thanks !
pete
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
hello all :)

this is what i have sofar :
i succeed in dividing the levels and get from 147.12.5.3 : 147.12.5 / 147.12 / 147.
that part works well :) each level is called level1, level2 and so on... the total string is levelx

next is to filter the list one level at a time, and mark the visible rows... the last part works marking goes well.
but i'm not able to filter the second, third,... other levels. only first works well.

ActiveSheet.Range("rngindeling").AutoFilter Field:=1
Selection.AutoFilter Field:=Range("rngindeling").Cells(2, 1).Column, _
Criteria1:=levelx, Operator:=xlAnd
Set rngfound = Cells.Find(levelx, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False)

ActiveSheet.Range("rngindeling").AutoFilter Field:=1
Selection.AutoFilter Field:=Range("rngindeling").Cells(2, 1).Column, _
Criteria1:=level1, Operator:=xlAnd
Set rngfound = Cells.Find(level1, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False)

the next line after those is the marking which goes well. the rows are marked, after that i clear the filter and go to next level...

am i doing something wrong ?

thanks,
pete
 
Upvote 0

Forum statistics

Threads
1,203,453
Messages
6,055,533
Members
444,794
Latest member
HSAL

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