Comment pousser les modifications vers une table Excel réussie et filtrée

Pour reference, j'ai une configuration similaire à: http://chandoo.org/wp/2012/11/27/extract-subset-of-data/ .

Donc, fondamentalement, j'ai 3 feuilles avec lesquelles je travaille. Il y a la feuille RawData qui contient une table avec vous qui connait datatables brutes. Ensuite, il y a la fiche principale qui a les critères qui seront filtrés puis une feuille de filtrage qui utilise à la fois pour créer un drop down menu afin que vous puissiez choisir ce que vous souhaitez filterr sur la table et il est tiré sur la feuille de filter pour la visualisation.

Ma question est donc: Quelle direction regarderais-je pour que si quelqu'un modifie la feuille de filter, il est ensuite poussé vers la feuille rawdata? Je pense à quelque chose dans le sens de

On worksheet change if target is not in row 1, 2, or 3, Search rawdata 'This is where I dont know exactly what I'd be doing copy target row to rawdata row 

Quelques exemples de différentes methods ci-dessous. Vous devrez évidemment changer la façon dont il sait quelle est la scope des données et quelles keys searchr.

Une fois que vous avez identifié la ligne pertinente, vous pouvez effectuer vos modifications aux données au besoin.

Ce qui suit est basé sur certaines lettres randoms dans A1: B12, et il est souhaitable de faire correspondre la combinaison de A et de B.

 '---Using Range.Find--- 'The simplest method is to create a new column in Excel 'The column should use a formula to combine the different columns you want to match on together into a key 'An example would be, to match on column A and B: =A1 & "|" & B1 'You can then use Range.Search to find the match Sub Example1() Dim searchRange As Range, matchedCell As Range Set searchRange = Worksheets("Sheet1").Columns("C") Set matchedCell = searchRange.Find( _ what:="c" & "|" & "e", _ LookIn:=XlFindLookIn.xlValues, _ lookat:=XlLookAt.xlWhole, _ MatchCase:=True) Debug.Print matchedCell.Address End Sub '---Using a keyed collection--- 'This method is faster if you need to do the lookups a lot 'It does not need pre-generated keys in a column (unlike method 1) 'Though if you have pre-generated keys it can be optimised a bit by only loading 'the column of Keys into the array rather than all the data Sub Example2() Dim dataRange As Range Dim arr Dim hashTable As Collection Dim i As Long Set dataRange = Worksheets("Sheet1").Range("A1:B12") arr = dataRange.Value 'load the data into an array Set hashTable = New Collection For i = LBound(arr, 1) To UBound(arr, 1) hashTable.Add i, arr(i, 1) & "|" & arr(i, 2) 'add the row index as the value, and the key as the lookup conditions joined together 'arr(i,1) etc will need to change depending on how you know which columns are the columns to match on 'if datatype matters (ie "1" <> 1 for your lookup) then do something like 'Vartype(arr(i,1)) & arr(i,1) & "|" & Vartype(arr(i,2)) & arr(i,2) Next i 'Now for each match you need to do, you can just find the row within dataRange by looking up in the lookupCollection 'eg to find "c|e": Debug.Print dataRange.Rows(hashTable("c" & "|" & "e")).Address End Sub