Copy from a text box

S

Stephen C

I have found some code to copy a cells data to a textbox as shown below. what
I require is the reverse, to copy the textbox data to a cell?

Private Sub Commandbutton1_click()
worksheets("Sheet2").Textbox1.Text = _
Worksheets("Sheet1").Range("B9").Text
End sub

I am using excel 2000
 
G

Gary''s Student

Sub stephen()
ActiveSheet.Shapes("Text Box 1").Select
With Range("A1")
.Value = Selection.Characters.Text
End With
End Sub
 
S

Stephen C

I had already tried that and it does not work, I have managed to get it to
work by changing the .text to .value.

Thanks for the help
 
C

Chip Pearson

Text is a read-only property of the Range object and contains the
actual text as displayed in the cell, governed by the formatting
applied to the cell. Value is read/write and is the underlying value
of the cell, regardless of how it is formatted for display.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
A

Alan Pederson

I am using Office 2007 and can not get this to work with a Textbox that is
directly on an Excel worksheet. Does this only work if it is on a form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top