Excel VBA Macro: Autofilter (Based on Cell Value)

preview_player
Показать описание
Excel VBA Macro: Autofilter (Based on Cell Value). In this video, we create a macro that filters data based on cell value. If you ever need to automatically filter data based on another cell in your workbook, with Excel VBA, you can use the code we write in this video to automatically filter data pertaining to a value in a cell that can be changed, without having to alter the code. The code specifies which worksheet it will be filtering, the starting point for the filtering, and then what cell will be used to filter by. The cell does not have to be on the same worksheet, and we can change the value of the cell as we please and filter by whatever we decide. After the filter is applied, only values that we want to see will be visible: giving you the freedom to change the value you filter by at will.

Data used in this video:

#ExcelVBA #ExcelMacro
Рекомендации по теме
Комментарии
Автор

5 years later and you saved my ass just because I actually forgot how to do this bs, thanks a lot man

praiserofthesun
Автор

Thanks man, I've been working so hard to figure this out, but now with this video and a little bit of customizing, I'm able to have my macro work. Really appreciate it!!!!

palamentor
Автор

Thankyou so much. This is what I was looking for.

pankajnegi
Автор

Helpful video. I didn't realize at first why Field was 2, but figure it out. You present well.

lanceross
Автор

Hello, thanks for the video! Can you explain how to filter on a specific cell that is in another sheet in the same file? I am trying to filter a column in my "report" sheet based on a cell in my "HOME" sheet.

averybrothers
Автор

How can you get a reference to a cell in the first row of filtered data?. For example, you filter those with an area less than 1000 sq. mi. and THEN you need to click on a button that shows all the elements of the region of the first element of that filtered set (but not only those less than 1000 sq.mi.?

alejandroesquivelcordero
Автор

How to filter multiple columns using cell value and can still function even if other values to be filtered is empty?

josebatoctoy
Автор

Great!!! Thanks Gregg you really helped me so much, +1Suscriptor

mmikeangel
Автор

I have made an excel file in which there is macro to hide zero value. If I run the macro, other values (except Zero) will be shown, and then if I again use filter, all the data shows. Any solution?? Any macro for both?

jayganesh
Автор

What to do when i have to filter by 2 values (2 or multiple cells values)

prathaprgowda
Автор

It’s just not working for me at all says subscript out of range and I can’t figure out why the only thing I’ve changed is column numbers

naomifagan
Автор

It's putting my filter on Row 1 when my data starts in Row4, why? I have the exact same code as you (it's messing up the format and filtering out the header)

brianfrank
Автор

Hello, how about filter based on specific value in the cell, for the example the value is "Amer", so the data will be show as Northern America, Latin Amer & Carib, etc

thomasrusli
Автор

Great video. Can i filter more than a single value? lets say if we have a date for example and i want to filter both date and range. Should i duplicate the Sheet("Sheets).Range etc...?

simo
Автор

It was a nice informative video Gregg..what will be the code if I want to run macro on ENTER key..?

dhirajp
Автор

More or less of what I wanted to be honest, but is there a way to clear the filter after running this?

Dexterx
Автор

Dude, I am about to break my work computer. I follow everything exactly but for me I get "Expected: End of statement" with the "Field" highlighted. It would greatly help if you had any suggestions on this!! thank you!

samuelborrero-maldonado
Автор

Hi, how to autofilter date range, for example from 07/07/2022 to 25/08/2022

swethakrishnak
Автор

Thanks so much but I have one question it's supported to 2013 version

RajeshwarUma
Автор

Thank you so much. It help a lot to a beginner like me. Can you please tell how can I filter 2 or more cell value. As you searched EASTERN EUROPE . but I want to search EASTERN EUROPE, NORTHERN AFRICA & OCEANIA.

raulspro