on-internet
← Community

Display selected range of cells in Textbox1

Stack Overflow ·

I am facing an issue while trying to display a selected range of cells from Excel to a UserForm textbox, say C1:E14. The code below is giving me an Runtime error '13' Type Mismatch: Private Sub CommandButton1_Click() Dim ActSheet As Worksheet Dim SelRange As Range Set ActSheet = ActiveSheet Set SelRange = Selection Range("TABLE").Select Application.Goto "TABLE" UserForm1.TextBox1.Text = Range("C1:E14").Value 'UserForm1.TextBox1.Text = Range("C1:E14").Select End Sub If I use .Value it's giving the above mentioned error, but if I use .Select "True" it is printing in the UserForm text box.

Comments

Sign in or sign up to comment and upvote.

No comments yet.