Créer une macro qui renvoie à une cellule vid
Fermé
cachou52fr
-
16 juin 2011 à 22:28
jen_peplu Messages postés 33 Date d'inscription samedi 4 décembre 2010 Statut Membre Dernière intervention 25 mars 2012 - 18 juin 2011 à 18:39
jen_peplu Messages postés 33 Date d'inscription samedi 4 décembre 2010 Statut Membre Dernière intervention 25 mars 2012 - 18 juin 2011 à 18:39
A voir également:
- Créer une macro qui renvoie à une cellule vid
- Créer une adresse mail - Guide
- Créer un compte gmail - Guide
- Créer une liste déroulante excel - Guide
- Créer un compte google - Guide
- Créer un compte instagram - Guide
1 réponse
jen_peplu
Messages postés
33
Date d'inscription
samedi 4 décembre 2010
Statut
Membre
Dernière intervention
25 mars 2012
18 juin 2011 à 18:39
18 juin 2011 à 18:39
Bonjour cachou52fr
Je pense que ce code répondra à ton attente.
Sub SelectCell()
Dim cel As Range
Dim ws As Worksheet
Dim ColG As Range
Set ws = Sheets("Feuil1")
Set ColG = ws.Range("G1:G" & Range("G1").End(xlDown).Row)
Range("G1").Select
For Each cel In ColG
If ActiveCell = "" Then GoTo sortie
If IsEmpty(Range("G2")) Then
Range("G2").Select
Exit Sub
End If
Range("G1").End(xlDown).Offset(1, 0).Select
If ActiveCell = "" Then GoTo sortie
Next cel
sortie:
End Sub
Bonne continuation.
A+
jen_peplu
Je pense que ce code répondra à ton attente.
Sub SelectCell()
Dim cel As Range
Dim ws As Worksheet
Dim ColG As Range
Set ws = Sheets("Feuil1")
Set ColG = ws.Range("G1:G" & Range("G1").End(xlDown).Row)
Range("G1").Select
For Each cel In ColG
If ActiveCell = "" Then GoTo sortie
If IsEmpty(Range("G2")) Then
Range("G2").Select
Exit Sub
End If
Range("G1").End(xlDown).Offset(1, 0).Select
If ActiveCell = "" Then GoTo sortie
Next cel
sortie:
End Sub
Bonne continuation.
A+
jen_peplu