Hello
is it possible to select a cell (by clicking on it) and then click on the button and transfer that row's data to userform?![]()
Hello
is it possible to select a cell (by clicking on it) and then click on the button and transfer that row's data to userform?![]()
How about![]()
Private Sub UserForm_Initialize() With ActiveCell.EntireRow Me.TxtID = .Range("A1") Me.TxtFirst = .Range("B1") Me.TxtLast = .Range("C1") End With End Sub
Hi,
One way would be to use the form's Initialise event. i.e.
Depends what you are trying to achieve.![]()
Private Sub UserForm_Initialize() Me.TxtID = Range("A" & ActiveCell.Row) Me.TxtFirst = Range("B" & ActiveCell.Row) Me.TxtLast = Range("C" & ActiveCell.Row) End Sub
You might like to consider instead of text boxes using List or ComboBoxes so that they contain all relevant values so that you can pick one. You can load the values by either using the .RowSource property of the control objects or the .AddItem code syntax
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Glad to help & thanks for the feedback.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks