XL 2010 erreur excel vba:erreur d'execution 424 objet requis

billal

XLDnaute Nouveau
salut;
j'ai essayé un petit programme mais il y a une ou j'ai pas pu la découvrir
voici le programme:
Private Sub ajouter_Click()
'les variables
Dim description_article As String
Dim Nr_art As String
Dim prix_article As Currency
Dim DL As Integer
DL = Range("B1000").End(xlUp).Row + 1
Dim HTVA As Currency
Dim TVA As Currency
Dim TTC As Currency
Dim NA As Variant



'la recherche

description_article = WorksheetFunction.VLookup(Range("K2"), Sheets("Article").Range("B3:D12"), 2, 0)
Nr_art = WorksheetFunction.VLookup(Range("k2"), Sheets("Article").Range("B3:D12"), 1, 0)
prix_article = WorksheetFunction.VLookup(Range("k2"), Sheets("Article").Range("B3:D12"), 3, 0)

'AJOUTER DANS LA FACTURE
Range("B" & DL) = Nr_art
Range("D" & DL) = prix_article
Range("C" & DL) = description_article
Range("E" & DL) = Range("K3")
Range("F" & DL) = Range("E" & DL) * prix_article
Range("K2:K3").ClearContents
Rows(DL + 1).EntireRow.Insert
NA = Worksheet.Function.CountA(Range("b10:b1000"))

'calcule de TVA


HTVA = WorksheetFunction.Sum(Range("F10:F" & DL))
TVA = HTVA * 0.06
TTC = TVA + HTVA
Range("F13").Offset(NA) = HTVA
Range("F14").Offset(NA) = TVA
Range("F15").Offset(NA) = TTC

End Sub
 

Discussions similaires


Haut Bas