Mémorisation d'une cellule sous VBA

M

Mithrandir

Guest
bonsoir à tous,

Débutant, je viens de faire un tableau où s'effectue un tri automatique.

Mais lorsque je rempli une ligne dans mon tableau, le tri se fait comme voulu mais ensuite je me retrouve avec la premiere cellule du tableau sélectionnée.

Pour faire 'plus propre' je souhaite garder la dernière cellule séléctionné car mon tableau est long.

Ce que je cherche c'est le code qui me permettra de MEMORISER la cellule sélectionner puis une fois le tri fait retourner à cette même cellule....

Merci
 
M

Mithrandir

Guest
Pour que ca soit plus parlant voici le code pour le tri (il y a 3 tableau à la suite):

If Intersect(Target.Columns, Columns('C:J')) Is Nothing Then
Range('C5:J41').Select
Selection.Sort Key1:=Range('H5'), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=5, MatchCase:=False, Orientation:=xlTopToBottom
Range('C46:J86').Select
Selection.Sort Key1:=Range('H46'), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=5, MatchCase:=False, Orientation:=xlTopToBottom
Range('C91:J130').Select
Selection.Sort Key1:=Range('H91'), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=5, MatchCase:=False, Orientation:=xlTopToBottom
End If

merci.
 

Discussions similaires

Réponses
4
Affichages
216
Réponses
6
Affichages
373

Statistiques des forums

Discussions
312 398
Messages
2 088 073
Membres
103 709
dernier inscrit
amin Saadaoui