XL 2013 Valeur commune sur plusieurs userform

yoyorobots

XLDnaute Nouveau
Bonjour,
je suis actuellement entrain de coder alors que se n'est pas du tout mon domaine.
Je souhaiterai faire une valeur commune pour plusieur userform pour ca j'ai la solution avec un public action as long sauf que je veux maintenant le mettre dans un rang("...:...")
voici le programme :
Private Sub ComboBox5_DropButtonClick()
ComboBox5.List = Sheets("DATA").Range("H2:H200").Value
End Sub
pour mieux comprendre je veux que ma variable action remplasse le H200
cordialement,
Yohann
 
Solution
Bonjour yoyorobots
toujours pas de fichier (pas évident)
une proposition
VB:
Private Sub CommandButton11_Click()
Dim nomrecherche As String
Dim ligne As Long
nomrecherche = Me.ComboBox2.Value
With Worksheets("ETAPE2")
ligne = .Range("M2:M300").Find(nomrecherche, Lookat:=xlWhole).Row
End With
With Worksheets("RECHERCHE") 
MsgBox (ligne)
.Range("A2:T2").Value = Sheets("ETAPE2").Range("A" & ligne & ":T" & ligne).Value
End With
End Sub
Cordialement
jean marie

vgendron

XLDnaute Barbatruc
hello..
pour faire simple.. rien compris...
c'est quoi ta variable action?? la dernière ligne de ta feuille Data??

Private Sub ComboBox5_DropButtonClick()
ComboBox5.List = Sheets("DATA").Range("H2:H" &Action).Value
End Sub
 

ChTi160

XLDnaute Barbatruc
Bonsoir yoyorobots
Bonsoir vgendron ,le Forum
Ce que j'ai cru comprendre Lol (manque un petit Fichier )
VB:
Private Sub ComboBox5_DropButtonClick()
Dim DerLgn As Long
With Sheets("DATA")
DerLgn = .Cells(.Rows.Count, 8).End(xlUp).Row
Me.ComboBox5.List = .Range("H2:H" & DerLgn).Value
End With
End Sub
Bonne fin de Soirée
jean marie
 

yoyorobots

XLDnaute Nouveau
Bonjour,
désoler si mon explication était si nul,
Vous m'avez bien aidé mais j'aurai un autre problème :

Private Sub CommandButton11_Click()
Worksheets("ETAPE2").Select
Dim nomrecherche As String
Dim ligne As Long
nomrecherche = ComboBox2.Value
ligne = Range("M2:M300").Find(nomrecherche, Lookat:=xlWhole).Row

Worksheets("RECHERCHE").Select
MsgBox (ligne)
Sheets("RECHERCHE").Range("A2:T2").Value = Sheets("ETAPE2").Range("A"& ligne:"T" & ligne).Value
End Sub

Je souhaiterai prendre en entier la ligne "ligne" sauf que j'ai une erreur de syntaxe dans le range
bien cordialement
yohann
 

ChTi160

XLDnaute Barbatruc
Bonjour yoyorobots
toujours pas de fichier (pas évident)
une proposition
VB:
Private Sub CommandButton11_Click()
Dim nomrecherche As String
Dim ligne As Long
nomrecherche = Me.ComboBox2.Value
With Worksheets("ETAPE2")
ligne = .Range("M2:M300").Find(nomrecherche, Lookat:=xlWhole).Row
End With
With Worksheets("RECHERCHE") 
MsgBox (ligne)
.Range("A2:T2").Value = Sheets("ETAPE2").Range("A" & ligne & ":T" & ligne).Value
End With
End Sub
Cordialement
jean marie
 

yoyorobots

XLDnaute Nouveau
Private Sub ComboBox1_DropButtonClick()
Worksheets("ETAPE1").Select
Dim DerLgn0 As Long

With Sheets("ETAPE1")
DerLgn0 = .Cells(.Rows.Count, 6).End(xlUp).Row
Me.ComboBox1.List = .Range("F2:F" & DerLgn0).Value
End With

Application.ScreenUpdating = False

Worksheets("ETAPE1").Select
Dim L As Integer
Dim N As String
N = ComboBox1.Value

L = Range("F2:F65536").Find(N, Lookat:=xlWhole).Row

TextBox9.Value = Cells(L, 1)
ComboBox7.Value = Cells(L, 2)
ComboBox8.Value = Cells(L, 3)
ComboBox9.Value = Cells(L, 4)
TextBox1.Value = Cells(L, 5)
TextBox11.Value = Cells(L, 7)
TextBox2.Value = Cells(L, 8)
TextBox5.Value = Cells(L, 9)
TextBox6.Value = Cells(L, 10)
TextBox12.Value = Cells(L, 11)
TextBox16.Value = Cells(L, 12)
TextBox17.Value = Cells(L, 13)

End Sub

J'aurai une autre petite question cette fonction m'affiche une erreur
1622703903116.png

Je suis désolé mais je ne sais si mon fichier peut se retrouver sur internet
 

Discussions similaires

Statistiques des forums

Discussions
312 082
Messages
2 085 167
Membres
102 801
dernier inscrit
mrclbl