PDA

View Full Version : Filter for a list of values



oharris
07-18-2006, 09:09 AM
Hello all, I hate to ask a question on a first post, but that appears to be what this forum is for.

I have a schedule in Excel that I have to keep up. Each item has a unique number associated with it. Each day, I get in an Excel sheet, a list of changes which can range anywhere from one line to hundreds of lines. For changes, the change list includes the unique numbers. I'd like to be able to filter for the numbers in the new sheet, so I can easily remove them and insert the changes, but I cant figure out any way to do this. I can't post the actual files, but for example, lets say my schedule contains 100 items numbered 1-100. The change file has changes listed to lines 22, 37, 53, 62, 73. How can I filter the main list to only show the same line numbers as the change file? Is there an easy way to do this I am overlooking? Thanks in advance.

OBP
07-18-2006, 10:11 AM
It would be much better to have the VBA code find each Change item for you and replace the data. All you would need to do is click the button.
Does the change list have the same name all the time?

mdmackillop
07-18-2006, 10:29 AM
Hi Oharris,
Welcome to VBAX
I think you're in luck. I just made up something very similar here. The code can be easily adapted to read in a list on numbers from the spreadsheet to replace the AT and CRN values as coded.
http://vbaexpress.com/forum/showthread.php?t=8832
If you need assistance, let us know.
Regards
MD

lucas
07-18-2006, 10:57 AM
Here's one that uses advanced filter to filter by selections you choose(enter them in col L) and copies them to another sheet for comparison. Maybe you can get it to work for what your doing.

lucas
07-18-2006, 07:54 PM
Column L works better if you use this:

Range("A4:K30").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
[L1], [L1].End(xlDown)), CopyToRange:=Range("Print!A3"), Unique:=False

lucas
07-18-2006, 08:19 PM
By putting your criteria range on another sheet or in a userform/messagebox you can use Action:=xlFilterInPlace to filter in place