miguelangelo
XLDnaute Occasionnel
bonjour Forum,
voilà, j'espere que vous pourrez m'aider à resoudre le chmil bliq...
j'ai retourné dans tous les sens je vois pas.
Situation, j'ai 2 onglets. "calcul loyer" et "annuel".
l'un cumul les informations du mois, pour en fin de période que les dites informations soient transférées sur l'"annuel".
Plusieurs intervenants, donc les écritures transférées vers l'onglet annuel doivent etre marqué d'un "ok".
j'espere qu'on me suit...
Procédure :
la macro fait un filtre sur les "ok", coupe les lignes concernées et les copie dans l'onglet annuel
tout se fait correctement sauf que au final, je ne trouve aucune trace des factures qui ne sont pas marquées "ok", ni dans l'onglet "annuel" ni dans l'onglet "calcul loyer".
Merci de m'éclairer parce que là je suis dans l'obscurité totale
Sub transfert_part()
Sheets("calcul loyer").Select
Range("a2").Select
Application.Goto Reference:="tri_courant"
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.AutoFilter Field:=1, Criteria1:="ok"
If Range("A2").End(xlDown) = "" Then GoTo suivant
Rows("3:" & Range("A3").End(xlDown).Row).Select
reponse = MsgBox("Transfert partiel pour " & Range("m1") & " " & "€", vbYesNo, "transfert")
If reponse = vbNo Then
ActiveSheet.ShowAllData
Application.Goto Reference:="tri_courant"
Selection.Sort Key1:=Range("O3"), Order1:=xlAscending, Key2:=Range("E3") _
, Order2:=xlAscending, Key3:=Range("C3"), Order3:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A3").Select
GoTo suivant
End If
Selection.Cut
Sheets("annuel").Select
Range("a3000").Select
ActiveSheet.Paste
Application.Run "TRI_annuel"
Sheets("calcul loyer").Select
ActiveSheet.ShowAllData
Application.Goto Reference:="tri_courant"
Selection.Sort Key1:=Range("O3"), Order1:=xlAscending, Key2:=Range("E3") _
, Order2:=xlAscending, Key3:=Range("C3"), Order3:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A3").Select
End
suivant:
MsgBox ("Aucune facture n'est selectionnée")
Application.CutCopyMode = False
Range("a3").Select
End Sub
voilà, j'espere que vous pourrez m'aider à resoudre le chmil bliq...
j'ai retourné dans tous les sens je vois pas.
Situation, j'ai 2 onglets. "calcul loyer" et "annuel".
l'un cumul les informations du mois, pour en fin de période que les dites informations soient transférées sur l'"annuel".
Plusieurs intervenants, donc les écritures transférées vers l'onglet annuel doivent etre marqué d'un "ok".
j'espere qu'on me suit...
Procédure :
la macro fait un filtre sur les "ok", coupe les lignes concernées et les copie dans l'onglet annuel
tout se fait correctement sauf que au final, je ne trouve aucune trace des factures qui ne sont pas marquées "ok", ni dans l'onglet "annuel" ni dans l'onglet "calcul loyer".
Merci de m'éclairer parce que là je suis dans l'obscurité totale
Sub transfert_part()
Sheets("calcul loyer").Select
Range("a2").Select
Application.Goto Reference:="tri_courant"
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.AutoFilter Field:=1, Criteria1:="ok"
If Range("A2").End(xlDown) = "" Then GoTo suivant
Rows("3:" & Range("A3").End(xlDown).Row).Select
reponse = MsgBox("Transfert partiel pour " & Range("m1") & " " & "€", vbYesNo, "transfert")
If reponse = vbNo Then
ActiveSheet.ShowAllData
Application.Goto Reference:="tri_courant"
Selection.Sort Key1:=Range("O3"), Order1:=xlAscending, Key2:=Range("E3") _
, Order2:=xlAscending, Key3:=Range("C3"), Order3:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A3").Select
GoTo suivant
End If
Selection.Cut
Sheets("annuel").Select
Range("a3000").Select
ActiveSheet.Paste
Application.Run "TRI_annuel"
Sheets("calcul loyer").Select
ActiveSheet.ShowAllData
Application.Goto Reference:="tri_courant"
Selection.Sort Key1:=Range("O3"), Order1:=xlAscending, Key2:=Range("E3") _
, Order2:=xlAscending, Key3:=Range("C3"), Order3:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A3").Select
End
suivant:
MsgBox ("Aucune facture n'est selectionnée")
Application.CutCopyMode = False
Range("a3").Select
End Sub