Combining two filters in VBA

Romano_odK

Active Member
Joined
Jun 4, 2020
Messages
379
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

The below code gives me all the lines with the value "Z-WEG" which work ok, but I actually need something more. What I need is for the "Magazijn" to be 1 and if there is indeed a line with Z-WEG, I also need the other lines if with the same "Artikelcode". So when in column "Locatie" the value is "Z-WEG' then also display the lines that has the same "Artikelcode" as the one where the value in "Locatie" is Z-WEG.


Thank you for your time and efforts.

Romano

VBA Code:
Zweg.Caption = "z-weg" & Chr(10) & Application.CountIf(Range("Locatie[Locatie]"), "=z-weg")

Locatie controle 3.34 beta.xlsm
ABCDEFGHI
6ArtikelcodeOmschrijvingOntvgstdatumAantalKostprijsVrrdrekStd_locatieMagazijnLocatie
7108002Kohler celband 9x3 mm grijs - 100 m04/10/20231506,203901Q14A1Z-WEG
8108003Kohler celband 9x3 mm grijs - 250 m02/10/20237810,763901Q13A1Q13B
9108003Kohler celband 9x3 mm grijs - 250 m02/10/20237810,763901Q13A1Z-WEG
10108003Kohler celband 9x3 mm grijs - 250 m02/10/20237810,763901Q13A1AAP
11108003Kohler celband 9x3 mm grijs - 250 m02/10/20237810,763901Q13A1Q13A
12108004Kohler celband 9x3 mm wit - 100 m13/11/20232005,283901Q14A1AAP
13108004Kohler celband 9x3 mm wit - 100 m13/11/20232005,283901Q14A1Q14A
14108004Kohler celband 9x3 mm wit - 100 m13/11/20232005,283901Q14A1Q14B
15108004Kohler celband 9x3 mm wit - 100 m13/11/20232005,283901Q14A1A00
16108004Kohler celband 9x3 mm wit - 100 m13/11/20232005,283901Q14A1Z-WEG
17108005Kohler celband 9x3 mm wit - 250 m01/11/20233610,713901Q12A1A00
18108005Kohler celband 9x3 mm wit - 250 m01/11/20233610,713901Q12A1AAP
19108005Kohler celband 9x3 mm wit - 250 m01/11/20233610,713901Q12A1Z-WEG
20108005Kohler celband 9x3 mm wit - 250 m01/11/20233610,713901Q12A1Q12B
Boekingen
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,215,431
Messages
6,124,855
Members
449,194
Latest member
HellScout

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