texte et numeric

dam3117

XLDnaute Occasionnel
bonjour à tous,

j'ai besoin que lorsque je valide, si mon label2 est remplis de chiffres cells(xlig,5) = une valeur numeric comme dans ma macro ci dessous.
Mais si mon label2 est remplis de chiffres et de lettre, cells(xlig,5) = une valeur texte.

merci à tous damien

xlig = Range('a65536').End(xlUp).Row + 1

Cells(xlig, 4) = Label5 'port
If IsNumeric(Label2) Then
Cells(xlig, 5) = CDbl(Label2)
Else: Cells(xlig, 5) = Label2
Cells(xlig, 6) = Label3 'nom
Cells(xlig, 7) = Label8 'pavillon
Cells(xlig, 9) = ComboBox1 'moyen
Cells(xlig, 10) = TextBox1 & ComboBox3 & ' ' & TextBox2 & ComboBox2 'position
Cells(xlig, 11) = ComboBox4 'zone ciem
Cells(xlig, 1) = Label10 'date
Cells(xlig, 12) = ComboBox5 'suite
Cells(xlig, 13) = ComboBox6 'plan
Cells(xlig, 3) = ComboBox7 'controle
Cells(xlig, 14) = ComboBox8 'infraction
Cells(xlig, 2) = TextBox3 'heure
Cells(xlig, 15) = IIf(CheckBox1, 'DEROUTEMENT', 'NON') 'DEROUTEMENT
Cells(xlig, 16) = TextBox5 'commentaires
Cells(xlig, 8) = Label25 ' LHT
If TextBox4 > '0' Then Cells(xlig, 16) = 'PV° ' & TextBox4 & ' ' & TextBox5

UserForm3.Hide

UserForm1.Hide
Unload Me
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End Sub
 

Discussions similaires

Réponses
18
Affichages
3 K

Statistiques des forums

Discussions
312 452
Messages
2 088 544
Membres
103 880
dernier inscrit
rafaelredsc