• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How do I copy cell content from worksheet to UserForm opened vbModeless

mdavid

Member
Hi,
I have a UserForm opened vbModeless, would like to click on cell on worksheet and append content of cell to a textbox on the UserForm, how can I code this?
Thanks for any help
David
 

vletm

Excel Ninja
mdavid
If You have an Excel-file of this case
then You should upload even sample of it here.
It would be much 'easier' for You to try to use any solution.
 

Belleke

Active Member
Hi,
Something like this?
This code goes in the Sheet module
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    UserForm1.Show
End Sub
And this code goes in the userform Initialize event.
Code:
Private Sub UserForm_Initialize()
    TextBox1.Value = ActiveCell.Value
End Sub
See example
 

Attachments

mdavid

Member
Thanks for this Belleke,
My logic is a little different, I want first to click on a cell which will open the UserForm with the clicked cell content in a TextBox on the form, much as you've done. Then with the Form still open I want to be able to click on other cells on the sheet and append the content of those cells to the TextBox on the UserForm.

Thanks for any help
David
 
Top