Autre incompatibilité excel 97

Seb

XLDnaute Occasionnel
Re bonsoir à tous,

Je viens voir car j'ai une incompabilité d'une macro qui marche sous 2003 mais pas sous excel 97 et je sais pas la résoudre...

Dans mon tableau excel 2003 j'ai une macro qui commence comme ça:

Private Sub UserForm_Initialize()
Dim cel As Range
'Récupération des chiffres
TextBox1.Value = ActiveCell.Value
TextBox3.Value = ActiveCell.Offset(0, -10).Value
TextBox2.Value = VBA.Strings.Format(ActiveCell.Offset(0, 2).Value, "# ##0.00 €")
TextBox4.Value = VBA.Strings.Format(ActiveCell.Offset(0, -7).Value, "# ##0.00 €")
TextBox6.Value = ActiveCell.Offset(0, 4)
TextBox5.Value = ActiveCell.Offset(0, -5).Value

'Récupération des données des Gammes
TextBox91.Value = Sheets("Base").Range("T3").Value
TextBox92.Value = Sheets("Base").Range("T4").Value
TextBox93.Value = Sheets("Base").Range("T5").Value
TextBox94.Value = Sheets("Base").Range("T6").Value
TextBox95.Value = Sheets("Base").Range("T7").Value

With Sheets("Repertoire N").Range("B4:B370")
Set cel = .Find(CDate(TextBox1), LookIn:=xlValues)
If Not cel Is Nothing Then TextBox96 = VBA.Strings.Format(cel.Offset(0, 3), "# ##0.00 €")
Set cel = .Find(CDate(TextBox1), LookIn:=xlValues)
If Not cel Is Nothing Then TextBox97 = VBA.Strings.Format(cel.Offset(0, 5), "# ##0.00 €")
Set cel = .Find(CDate(TextBox1), LookIn:=xlValues)
If Not cel Is Nothing Then TextBox98 = VBA.Strings.Format(cel.Offset(0, 7), "# ##0.00 €")
Set cel = .Find(CDate(TextBox1), LookIn:=xlValues)
If Not cel Is Nothing Then TextBox99 = VBA.Strings.Format(cel.Offset(0, 9), "# ##0.00 €")
Set cel = .Find(CDate(TextBox1), LookIn:=xlValues)
If Not cel Is Nothing Then TextBox100 = VBA.Strings.Format(cel.Offset(0, 11), "# ##0.00 €")
End With...............


c'est un userform qui reprend des données d'une autre feuille avec une fonction recherche. La textbox1 ayant la donnée que la macro doit retrouver dans la feuille "Repertoire N"

je sais pas du tout comment faire...

Quelqu'un a une idée???
 

ledzepfred

XLDnaute Impliqué
Re : Autre incompatibilité excel 97

bonsoir Seb,

il faut utiliser le mode débogage pour identifier la ligne qui coince: quand tu as le message d'erreur cliques sur debogage, comme c'est une procédure d'initialisation d'un USF, ton code devrait s'arreter à la commande d'appel du USF (userform.show), tapes sur F8 jusqu'à la ligne qui bugge dans la procédure.
Ne connaissant pas les subtilités de Excel2007, je ne peux t'en dire plus

A+
 

Statistiques des forums

Discussions
312 697
Messages
2 091 080
Membres
104 753
dernier inscrit
FLIS