I know what the result of this code is but I don't understand the terms/syntax. Can someone, explain in layman's terms what it's doing please?
Thanks![]()
Please Login or Register to view this content.
MissDB
I know what the result of this code is but I don't understand the terms/syntax. Can someone, explain in layman's terms what it's doing please?
Thanks![]()
Please Login or Register to view this content.
MissDB
In effect, it means if you multiply two negative numbers, you get a positive answer. So, "Not" and "Nothing" could be interpreted as "Match". If the two range meet(Intersect), do the lines after the meet.
Sorry I still don't understand. I know that this code looks to see if there is a filter on range F18 and then clears it but how is it actually doing this? What does the Intersect bit do?
Intersect can be looked at like a crossroads on the road. If not intersect is nothing translates into, if one car driving across the crossroads doesn't crash into the car driving up or down the crossroads, then do nothing. So if the Cell F8 is in the autofilter range and you enter something in it, the cars crashed, so do something. If something is entered in another cell, the cars didn't crash, so do nothing.
Does that help?
You have two ranges(or cells), that is AutoFilter.Range and Range("F18"). When these two lines( Ranges) intersect (meet) then do the rest of the code. If they do not intersect, nothing will happen and the code jumps to the next if. I hope it is now clear.
So, if there is a filter applied to F18 it will un-filter, if not it will leave as is?
You have two Ifs. If the auto filter is on is the first (if test) which is nothing to do with the second if statement, but if the filter is off, that is, if the return is false on the first if statement, the code will not test the second(meet) line. In other words, both ifs statements need to return true in order for the code to run. In order the code to run from for A-Z, the filter should be on and second test if the two range intersect, If Not Intersect(.AutoFilter.Range, .Range("F18")) Is Nothing Then. Other wise the code returns false.
Last edited by AB33; 06-09-2016 at 05:21 AM.
Thank you all very much. Very helpful. I think I've got it now! I love this site :-)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks