Manisha
Manisha

Reputation: 13

How to filter Date column in vba based on Quarter and Year cell input value?

I want to filter Column B based on Column G where the cell value is blank and cell value(Year and Quarter) is equal to the Range("O2")& Range("P2"). I have created column H( where I have extracted year and quarter from column G-Date Closed and concatenated it). Is there a way to filter a particular business group(like ASIA) where Date Closed(column G) is blank and Year and Quarter is equal to the cell drop down value in Range O2 and P2?enter image description here [1]: https://i.sstatic.net/3kf2J.png

Upvotes: 0

Views: 168

Answers (1)

zombieHairdu
zombieHairdu

Reputation: 1

sub filter()
dim rg as range, crg as range
set rg = range("A4").currentregion
set crg = range("A1").currentregion

rg.advancedfilter xlfilterinplace, crg
end sub

AdvancedFilter can do this, you'll need to insert 3 rows above your table. Copy your headers into row A:A then directly below your headers place your criteria for sort. If you want to find blanks just put a "=" in the cell without quotes.

Upvotes: 0

Related Questions