XL 2010 reccupere l'année seulement d'un textbox

kaid

XLDnaute Occasionnel
Bonjour
j'aimerai reccupere l'année d'un textbox par ex:

quand je saisie une date dans un textbox1= 01/01/20017
textbox2 m'affiche automatiquement 2017
 

kaid

XLDnaute Occasionnel
merci
j'ai 4 textbox avec des N° de serie condition avec les 4 premiers chiffres "left" 3101,3102,3103,3104
si textbox1 = 3101000001 alor textbox2 = A
si textbox1 = 3102000009 alor textbox2 = B
si textbox1 = 3103000008 alor textbox2 = C
si textbox1 = 3104000004 alor textbox2 = D
 

Robert

XLDnaute Barbatruc
Repose en paix
Re,

Tu as écris la condition il ne te restait plus qu'à convertir en langage VBA...

VB:
If Left(Me.TextBox1.Value, 4) = "3101" Then Me.TextBox2.Value = "A"
If Left(Me.TextBox1.Value, 4) = "3102" Then Me.TextBox2.Value = "B"
If Left(Me.TextBox1.Value, 4) = "3103" Then Me.TextBox2.Value = "C"
If Left(Me.TextBox1.Value, 4) = "3104" Then Me.TextBox2.Value = "D"
 

Discussions similaires

Réponses
19
Affichages
570

Statistiques des forums

Discussions
311 725
Messages
2 081 941
Membres
101 846
dernier inscrit
Silhabib