Userform, textbox copy to sheet

jamescooper

Well-known Member
Joined
Sep 8, 2014
Messages
636
Code:
Private Sub ToggleButton2_Click()
 
Me.TextBox1.Copy
Sheets("Data Sheet").Range("L" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Struggling to achieve a simple copy to the next available row in column L from a textbox in a userform.

It is failing on line 2.

Any ideas please?

Thanks.
 

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,065
try


Sheets("Data Sheet").Range("L" & Cells(Rows.Count, "L").End(xlUp).Row+1).PasteSpecial Paste:=xlPasteValues
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,205
Office Version
365
Platform
Windows
How about
Code:
Sheets("Data Sheet").Range("L" & Rows.Count).End(xlUp).Offset(1, 0).Value = Me.TextBox1
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,205
Office Version
365
Platform
Windows
Glad we could help & thanks for the feedback
 

Forum statistics

Threads
1,077,777
Messages
5,336,192
Members
399,069
Latest member
haxahid

Some videos you may like

This Week's Hot Topics

Top