Hello,
suite à un besoin, voici une fonction qui permet inverser une plage de cellule.
Ex : selectionner les cellules non vide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 InverseSelection(Range("A1:A100"), _ Range("A1:A100").SpecialCells(xlCellTypeBlanks)).Select
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Public Function InverseSelection(ByVal rngFull As Range, _ ByVal rngSel As Range) As Range ' permet inverser une selection Dim rng As Range Dim cell As Range For Each cell In rngFull.Cells If Intersect(rngSel, cell) Is Nothing Then If rng Is Nothing Then Set rng = cell Else Set rng = Union(rng, cell) End If End If Next cell Set InverseSelection = rng Set cell = Nothing Set rng = Nothing End Function





Répondre avec citation

et

si la réponse vous a été utile !


Partager