Copy from text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to use a macro to copy data from a text box to a cell.

To copy the contents of TextBox10 on sheet "Customer Info" to cell B43 on
sheet "Answers" I have tried recording a macro whilst highlighting the text
and then manually copying it, but that doesn't work. I have also tried the
code :

Sheets("Answers").Select
Range("B43").Value=Worksheets("Customer Info).TextBox10.Text

which I found in another thread on this board.

but I get a run-time error '438' : object doesn't support this property or
method (on the second line of this.)

Anyone got any ideas???

Thanks

Phil
 
Phil,

Give this a whirl

Range("B43").Value=Worksheets("Customer
Info).OLEObjects("TextBox10").Object.Text


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
Hi Bob

Unfortunately that doesn't work either, now it comes up with Run-Time error
'1004' : Unable to get the OLEObjects property of the Worksheet class.

Any further ideas? Or is something set up wrong somewhere on my computer?

Thanks

Phil
 
Where did yuou get the textbox from in Excel?

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
It was from the Drawing toolbar (at least I'm 99% sure it was...)

Would that make a difference?
 
Try this then

Range("B43").Value=Worksheets("Customer Info).TextBoxes("TextBox10").Text

make sure you get the name correct

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
OK now we get Run-time error 1004 : Unable to get the TextBoxes property of
the Worksheet class.

I'm starting to think I might do better simply using a cell rather than a
text box!! Are there any reasons why that might not be a good idea?

Phil
 
Back
Top