bonjour
je voudrais affecter la valeur d'une cellule à un label
j'ai ecris le code suivant mais ca ne fonctionne pas
merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part UserForm5.Label51.Caption = Range("eg142")
bonjour
je voudrais affecter la valeur d'une cellule à un label
j'ai ecris le code suivant mais ca ne fonctionne pas
merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part UserForm5.Label51.Caption = Range("eg142")
bonsoir fmris le forum tu la mis ou cette ligne de code???
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 Private Sub UserForm_Initialize() Label51.Caption = Range("eg142") End Sub
ci joint le code avec l'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113 Private Sub OptionButton7_Click() '**********mets la config par defauten HBW TextBox68.Visible = True TextBox104.Visible = True Label35.Visible = True Label41.Visible = True TextBox105.Visible = False Label66.Visible = False Frame12.Visible = False UserForm5.Label42.Visible = True UserForm5.Label43.Visible = True UserForm5.Label44.Visible = True UserForm5.Label45.Visible = True UserForm5.Label46.Visible = True UserForm5.Label47.Visible = True UserForm5.Label48.Visible = True UserForm5.Label49.Visible = True UserForm5.Label50.Visible = True UserForm5.Label51.Visible = True UserForm5.Label52.Visible = True UserForm5.Label53.Visible = True UserForm5.Label54.Visible = True UserForm5.Label55.Visible = True UserForm5.Label56.Visible = True UserForm5.Label57.Visible = True UserForm5.Label58.Visible = True UserForm5.Label59.Visible = True UserForm5.Label60.Visible = True UserForm5.Label61.Visible = True UserForm5.Label62.Visible = True UserForm5.Label63.Visible = True UserForm5.Label64.Visible = True UserForm5.Label65.Visible = True UserForm5.Label10.Caption = "Echelle (µm)" UserForm5.Label11.Caption = "Mes 1 (HBW)" UserForm5.Label12.Caption = "Mes 2 (HBW)" UserForm5.Label14.Caption = "Mes 3 (HBW)" '***********laisse apparaitre les nouvelles textbox 'Range("if7") = "" UserForm5.TextBox11.ControlSource = "ep142" UserForm5.TextBox12.ControlSource = "ep143" UserForm5.TextBox13.ControlSource = "ep144" UserForm5.TextBox14.ControlSource = "ep145" UserForm5.TextBox15.ControlSource = "ep146" UserForm5.TextBox16.ControlSource = "ep147" UserForm5.TextBox17.ControlSource = "ep148" UserForm5.TextBox18.ControlSource = "eq142" UserForm5.TextBox19.ControlSource = "eq143" UserForm5.TextBox20.ControlSource = "eq144" UserForm5.TextBox21.ControlSource = "eq145" UserForm5.TextBox22.ControlSource = "eq146" UserForm5.TextBox23.ControlSource = "eq147" UserForm5.TextBox24.ControlSource = "eq148" UserForm5.TextBox25.ControlSource = "er142" UserForm5.TextBox26.ControlSource = "er143" UserForm5.TextBox27.ControlSource = "er144" UserForm5.TextBox28.ControlSource = "er145" UserForm5.TextBox29.ControlSource = "er146" UserForm5.TextBox30.ControlSource = "er147" UserForm5.TextBox31.ControlSource = "er148" '**********mets les labels en config HBW UserForm5.Label42.Caption = "Mes 1 (HBW)" UserForm5.Label50.Caption = "Mes 2 (HBW)" UserForm5.Label58.Caption = "Mes 3 (HBW)" Range("ef142") = UserForm5.Label43.Caption UserForm5.Label44.Caption = "ef143" UserForm5.Label45.Caption = Range("ef144").Select UserForm5.Label46.Caption = Range("ef145") UserForm5.Label47.Caption = Range("ef146") UserForm5.Label48.Caption = Range("ef147") UserForm5.Label49.Caption = Range("ef148") UserForm5.Label51.Caption = Range("eg142") UserForm5.Label52.Caption = Range("eg143") UserForm5.Label53.Caption = Range("eg144") UserForm5.Label54.Caption = Range("eg145") UserForm5.Label55.Caption = Range("eg146") UserForm5.Label56.Caption = Range("eg147") UserForm5.Label57.Caption = Range("eg148") UserForm5.Label59.Caption = Range("eh142") UserForm5.Label60.Caption = Range("eh143") UserForm5.Label61.Caption = Range("eh144") UserForm5.Label62.Caption = Range("eh145") UserForm5.Label63.Caption = Range("eh146") UserForm5.Label64.Caption = Range("eh147") UserForm5.Label65.Caption = Range("eh148") End Sub
Bsr, fmris, laetitia,
et en rajoutant un .value ex:
A+
Code : Sélectionner tout - Visualiser dans une fenêtre à part Label51.Caption = Range("eg142").Value
c'est quoi cet intrus?Que fait le Select?
Code : Sélectionner tout - Visualiser dans une fenêtre à part UserForm5.Label45.Caption = Range("ef144").Select
Re, j'ai essayé avec un option buton et un label le code fonctionne.
A quoi sert le select?
EDIT: Bsr Mercatog, dsl j'ai pas vu ton message![]()
Salut
Te convient-il ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 UserForm1.Label1.Caption = Sheets("Feuil1").Range("a2").Value Userform1.Show
Partager