Select suivante vide

T

Temjeh

Guest
Bonjour a tous
Je ne sais pas pourquoi mais ce site et tres lourd ou c'est mon ordi je prend 1min par page pour loader

Boff assez de pleure

Je suis a la réalisation d'une macro et je voudrais y inclure:

Je voudrait qu'il sélectionne la case plus 1
Ex si dans mon code je lui dit:

If "F2"= T then
Range "A18".select ...et ici je veut (4) qu'il sélectionne A18 si vide sinon A19 ou A20 ou A21

Merci et bonne journée

Temjeh
 
L

Lagaff

Guest
tiens voila un chti code ki t'aidera surement ... je le fais rapido car j'ai po trop de temps là ...

bon voila comment je vois la chose : tu rentres tes données sur une colonne (remplacé A2 par B2, dans le cas d'une ligne), par exemple la colonne A ...

alors la sélection de ta prochaine cellule vide dans cette colonne est donnée par :


Range("A1").Select
Selection.End(xlDown).Select
Selection.Range("A2").Select


ça marche ... mais je ne sais pas si je répond vraiment à ta question ...

bon aprem ...
 
T

Temjeh

Guest
J'ai fait ceci mais il me copie a la suite toujours A2:E2 je voudrait Si If Range("F3") = "N" Then Range("A3:E3").Select.....

Sub Notes_Spéciales()

If Range("F2") = "N" Then
Range("A2:E2").Select
Selection.Copy
Else
If Range("A18") = "" Then
Range("A18").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else

If Range("A19") = "" Then
Range("A19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else

If Range("A20") = "" Then
Range("A20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else

If Range("A21") = "" Then
Range("A21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False


If Range("F3") = "N" Then
Range("A3:E3").Select
Selection.Copy
If Range("A18") = "" Then
Range("A18").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else

If Range("A19") = "" Then
Range("A19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else

If Range("A20") = "" Then
Range("A20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else

If Range("A21") = "" Then
Range("A21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub


Merci de votre aide
 

Discussions similaires

Statistiques des forums

Discussions
314 162
Messages
2 106 591
Membres
109 632
dernier inscrit
koetz