ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programatically control a shapes TextBox (https://www.excelbanter.com/excel-programming/341129-programatically-control-shapes-textbox.html)

Francis Brown[_2_]

Programatically control a shapes TextBox
 
I Have two Text Boxes on a worksheet. They are using the default names. Text
Box 1 and Text Box 2.
I wish to have a code module copy the text from box 1 to box 2.

I was trying code along the following lines but this does not work.

Public Sub copytext()
Dim copytext As String
copytext = ActiveSheet.Shapes("Text Box 1").Characters.Text
ActiveSheet.Shapes("Text Box 2").Characters.Text = copytext
End Sub

I'am using Excel 97

Any Help Much appreciated.

Tom Ogilvy

Programatically control a shapes TextBox
 
Public Sub copytext()
ActiveSheet.Textboxes("Text Box 2").Text = _
ActiveSheet.Textboxes("Text Box 1").Text
End Sub

--
Regards,
Tom Ogilvy


"Francis Brown" <Francis wrote in message
...
I Have two Text Boxes on a worksheet. They are using the default names.

Text
Box 1 and Text Box 2.
I wish to have a code module copy the text from box 1 to box 2.

I was trying code along the following lines but this does not work.

Public Sub copytext()
Dim copytext As String
copytext = ActiveSheet.Shapes("Text Box 1").Characters.Text
ActiveSheet.Shapes("Text Box 2").Characters.Text = copytext
End Sub

I'am using Excel 97

Any Help Much appreciated.




Francis Brown

Programatically control a shapes TextBox
 
Thanks for Help.

"Tom Ogilvy" wrote:

Public Sub copytext()
ActiveSheet.Textboxes("Text Box 2").Text = _
ActiveSheet.Textboxes("Text Box 1").Text
End Sub

--
Regards,
Tom Ogilvy


"Francis Brown" <Francis wrote in message
...
I Have two Text Boxes on a worksheet. They are using the default names.

Text
Box 1 and Text Box 2.
I wish to have a code module copy the text from box 1 to box 2.

I was trying code along the following lines but this does not work.

Public Sub copytext()
Dim copytext As String
copytext = ActiveSheet.Shapes("Text Box 1").Characters.Text
ActiveSheet.Shapes("Text Box 2").Characters.Text = copytext
End Sub

I'am using Excel 97

Any Help Much appreciated.






All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com