Private Sub CommandButton1_Click()
Dim i As Integer
' Envoi le Montant Devis vers feuille N° Enregistrement Devis Divers
Application.ScreenUpdating = False
' Ouverture du fichier Devis-Facture BMC
Workbooks.Open ("G:\BMC\Devis - Facture BMC V6.0" & ".xlsm")
Windows("Devis - Facture BMC V6.0" & ".xlsm").Activate
With Sheets("Enregistrement Devis")
.Select
For i = 1 To .[A65000].End(3).Row '2000
If .Cells(i, 1) = CDbl(TextBox1) Then
'si N° est numeric il faut convertir textbox1 sinon supprimer le cdbl(...)
.Cells(i, 1).Offset(0, 11).Value = Textbox2
Exit For
End If
Next
End With
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton1_Click()
Dim lig As Integer
Application.ScreenUpdating = False
Workbooks.Open ("G:\BMC\Devis - Facture BMC V6.0" & ".xlsm")
With Windows("Devis - Facture BMC V6.0" & ".xlsm")
.Activate
With .Sheets("Enregistrement Devis")
.Select
lig = Application.Match(CDbl(Textbox2), [A1:A65000], 0)
If IsNumeric(lig) Then .Cells(lig, 11) = Textbox2
End With
End With
Application.ScreenUpdating = True
End Sub