Macro pour base planning

Christian0258

XLDnaute Accro
Bonjour à tout le forum,

Je souhaiterais votre aide afin d'écrire une macro pour compléter cette appli... voir fichier joint avec explications.

Je vous remercie, par avance, pour le temps que vous voudrez bien vouloir m'accorder.

Bien amicalement,
Christian
 

Pièces jointes

  • Base planning.xlsm
    98.7 KB · Affichages: 116

jpb388

XLDnaute Accro
Bonjour a tous
dans la macro CommandButton1_Click
les .range ou .cells fonctionnent avec un with si pas de with mettre le nom de nom de la feuille concernée devant
with feuil1
.range
end with

feuil1.range

ou si c'est la feuille active range sans point devant
 

jpb388

XLDnaute Accro
re
Code:
Private Sub CommandButton1_Click()    'valider
    Dim cel As Range, C As Byte, DerL As Integer, LD As Long, Lf As Long
    Dim X As Double
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    Application.Calculation = xlCalculationManual
    With Feuil1
        X = Replace(UserForm2.ComboBox3, "%", "") / 100
        X = .Range("AF" & Me.ComboBox2.ListIndex + 20).Value / 5 * X
        For L = LD To Lf
            If test(.Range("AA" & L)) = False Then
                .Range("AB" & L).Value = UserForm2.ComboBox2
                .Range("AC" & L).Value = X
                .Range("AD" & L).Value = UserForm2.ComboBox3
                End If
        Next L
        UserForm2.ComboBox2.ListIndex = -1
        UserForm2.ComboBox3.ListIndex = -1
       
    End With
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
    Unload Me
End Sub
voila la rectif mais quand même cela ne fonctionne pas car
la fonction ou procédure test n'existe pas
ld et lf =0 2 eme source d'erreur
le reste a priori est bon
 

Discussions similaires

Statistiques des forums

Discussions
312 096
Messages
2 085 254
Membres
102 839
dernier inscrit
Tougtoug