Tps de calcul

T

Titou

Guest
Bonjour,

j'ai un problème, j'ai fait une userform avec un bouton qui ajoute des données dans une feuille.
cependant maintenant lorsque je lance la procédure il est ecrit en bas à gauche "Recalcul 100%".

depuis qu'il m'affiche ceci tout le programme ralentit...

que faire

Merci d'avance

Titou


voici la procédure dans le bouton



Private Sub CmdAjouter_Click()

If TextBox2.Value = "" Then
TextBox2.Value = 0
End If

If TextBox4.Value = "" Then
TextBox4.Value = 0
End If

If TextBox6.Value = "" Then
TextBox6.Value = 0
End If

If TextBox8.Value = "" Then
TextBox8.Value = 0
End If

If TextBox10.Value = "" Then
TextBox10.Value = 0
End If


If TextBox12.Value = "" Then
TextBox12.Value = 0
End If


If TextBox14.Value = "" Then
TextBox14.Value = 0
End If

If TextBox16.Value = "" Then
TextBox16.Value = 0
End If



Dim j As Integer
j = 5

If ComboBox1.Text = "" Then
Call MsgBox("Merci de spécifier la centrale d'enrobé", vbCritical + vbOKOnly, "Erreur")
Exit Sub
Else
If ComboBox2.Text = "" Or ComboBox3.Text = "" Then
Call MsgBox("Champs de saisie imcomplet", vbCritical + vbOKOnly, "Erreur de saisie")
Exit Sub
End If
End If

While Feuil3.Range("C" & j) <> ""
If (Feuil3.Range("C" & j)) = ComboBox3 Then
Call MsgBox("Une même prestation est déjà dans la liste", vbCritical, "Erreur")
Exit Sub
End If
j = j + 1
Wend




Feuil3.Activate
Range("A" & j) = ComboBox1
Range("B" & j) = ComboBox2
Range("C" & j) = ComboBox3
Range("E" & j) = TextBox17


Range("G" & j) = ComboBox4 'composant 1
Range("H" & j) = ComboBox5
Range("I" & j) = ComboBox6
Range("J" & j) = TextBox1 'cout 1
Range("K" & j) = TextBox2 'quantité 1

Range("O" & j) = ComboBox7 'composant 2
Range("P" & j) = ComboBox8
Range("Q" & j) = ComboBox9

Range("R" & j) = TextBox3 'cout 2
Range("S" & j) = TextBox4 'quantité 2


Range("w" & j) = ComboBox10 'composant 3
Range("x" & j) = ComboBox11
Range("y" & j) = ComboBox12
Range("Z" & j) = TextBox5 'cout 3
Range("AA" & j) = TextBox6 'quantité 3

Range("ae" & j) = ComboBox13 'composant 4
Range("Af" & j) = ComboBox14
Range("AG" & j) = ComboBox15
Range("AH" & j) = TextBox7 'cout 4
Range("AI" & j) = TextBox8 'quantité 4



Range("am" & j) = ComboBox16 'additif 1
Range("An" & j) = ComboBox17
Range("Ao" & j) = ComboBox18
Range("AP" & j) = TextBox9 'cout add 1
Range("AQ" & j) = TextBox10 'quantité add 1

Range("au" & j) = ComboBox19 'additif 2
Range("Av" & j) = ComboBox20
Range("Aw" & j) = ComboBox21
Range("AX" & j) = TextBox11 'cout add 2
Range("AY" & j) = TextBox12 'quantité add 2

Range("bc" & j) = ComboBox22 'bitume
Range("bd" & j) = ComboBox23
Range("be" & j) = ComboBox24
Range("BF" & j) = TextBox13 'cout bitume
Range("BG" & j) = TextBox14 'quantité bitume

Range("Bk" & j) = ComboBox25 'fabrication
Range("bl" & j) = ComboBox26
Range("bm" & j) = ComboBox27
Range("BN" & j) = TextBox15 'cout fabrication
Range("BO" & j) = TextBox16 'quantité fabrication




Call tri_enrob2
' Range("A5").Select
'Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:= _
' xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Call MsgBox("Le nouveau client est bien ajouté dans la bibliothèque", vbOKOnly, "Création d'une nouvelle entrée")
'Call EffaceClient
Call UserForm_Initialize

End Sub
 
S

Sylvain

Guest
bonsoir,

une idée : peut-être qu'excel recalcule ta feuille à chaque fois que tu y inscris une valeur.

Dans ce cas tu peux faire comme ceci :
avant de copier tes informations sur ta feuille :
Application.Calculation = xlManual
puis tu colles les valeurs de ton formulaire.
une fois collées :
Calculate
pour recalculer ta feuille
puis on n'oublie pas de remettre :
Application.Calculation = xlAutomatic

A+
 

Discussions similaires

Statistiques des forums

Discussions
312 323
Messages
2 087 296
Membres
103 510
dernier inscrit
baloty