XL 2016 position Vba

Guismo33

XLDnaute Occasionnel
Bonjour à tous,

je recherche une formule Vba pour garder la position des Cells et en changeant de lignes, petit fichier a l'appuie

Mercie à vous
 

Pièces jointes

  • essaie position.xlsx
    9.7 KB · Affichages: 28

vgendron

XLDnaute Barbatruc
Hello
avec ce code

VB:
Sub pos()

'MsgBox Columns.Count
LastCol1 = Cells(1, Columns.Count).End(xlToLeft).Column
LastCol2 = Cells(3, Columns.Count).End(xlToLeft).Column
Set ListeInit = Range("C1").Resize(1, LastCol1 - 2)

Set ListeRech = Range("C3").Resize(1, LastCol2 - 2)

i = 1
For Each ele In ListeInit
    Set c = ListeRech.Find(ele, lookat:=xlWhole)
    If Not c Is Nothing Then
        Cells(6, c.Column) = i
        i = i + 1
    End If
Next ele
       
End Sub
 

Discussions similaires

Réponses
1
Affichages
392

Statistiques des forums

Discussions
312 360
Messages
2 087 593
Membres
103 604
dernier inscrit
CAROETALEX59