Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Récupérer les informations d'une ligne dans un userform

2 réponses
Avatar
Lionel
Salut à tous,

J'aimerai pouvoir récupérer les informations d'une ligne dans un userform
(textbox) de modification.

Pourriez vous m'aider à trouver une procédure pour cela.

Merci de votre précieuse aide !

Lionel

2 réponses

Avatar
lSteph
Bonsoir,
Comment envisages-tu, toute une ligne dans un textbox?
Voici un exemple un peu simpliste , http://cjoint.com/?dqwQxzqSpY
j'ai mis min et max suivant lignes colonnes
dans la fenêtre des propriétés pour les compteurs(SpinButton1et 2)
qui varient selon i et j dans le code du userform:

'''*****
Dim i As Byte, j As Long
Private Sub CommandButton1_Click()
ActiveCell = TextBox1
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub SpinButton1_Change()
i = SpinButton1
Cells(ActiveCell.Row, i).Select
TextBox1 = ActiveCell
Label1 = ActiveCell.Address
End Sub
Private Sub SpinButton2_Change()
j = SpinButton2
Cells(j, ActiveCell.Column).Select
TextBox1 = ActiveCell
Label1 = ActiveCell.Address
End Sub
Private Sub UserForm_Initialize()
TextBox1 = ActiveCell
Label1 = ActiveCell.Address
End Sub
'''****
'lSteph

"Lionel" a écrit dans le message de news:
%
Salut à tous,

J'aimerai pouvoir récupérer les informations d'une ligne dans un userform
(textbox) de modification.

Pourriez vous m'aider à trouver une procédure pour cela.

Merci de votre précieuse aide !

Lionel




Avatar
lSteph
...petite rectification pour la synchro des spinbuttons et mode d'entrée de
la valeur du textbox dans les cellules:

Dim i As Byte, j As Long
Private Sub CommandButton1_Click()
ActiveCell.FormulaLocal = TextBox1.Value
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub SpinButton1_Change()
i = SpinButton1
Cells(j, i).Select
TextBox1 = ActiveCell
Label1 = ActiveCell.Address
End Sub
Private Sub SpinButton2_Change()
j = SpinButton2
Cells(j, i).Select
TextBox1 = ActiveCell
Label1 = ActiveCell.Address
End Sub
Private Sub UserForm_Initialize()
TextBox1 = ActiveCell
Label1 = ActiveCell.Address
i = ActiveCell.Column
j = ActiveCell.Row
SpinButton1 = i
SpinButton2 = j

End Sub

'lSteph
"Lionel" a écrit dans le message de news:
%
Salut à tous,

J'aimerai pouvoir récupérer les informations d'une ligne dans un userform
(textbox) de modification.

Pourriez vous m'aider à trouver une procédure pour cela.

Merci de votre précieuse aide !

Lionel