Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default copy to a text box

is it possible using a command button to copy text from a cell in sheet1 and
paste it into a text box in sheet 2
thankyou john
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default copy to a text box

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

Assuming the textbox is from the control toolbox toolbar as is the
commandbutton.

--
Regards,
Tom Ogilvy


"john tempest" wrote:

is it possible using a command button to copy text from a cell in sheet1 and
paste it into a text box in sheet 2
thankyou john

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default copy to a text box

thankyou tom that worked perfectly

"Tom Ogilvy" wrote:

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

Assuming the textbox is from the control toolbox toolbar as is the
commandbutton.

--
Regards,
Tom Ogilvy


"john tempest" wrote:

is it possible using a command button to copy text from a cell in sheet1 and
paste it into a text box in sheet 2
thankyou john

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default copy to a text box

i have a problem
the code worked perfectly,but i want to put in another button to follow on
..i tried this and the text from the first command button was deleted and the
text from the second commmand button was displayed i need these to follow on
thank you john

"john tempest" wrote:

thankyou tom that worked perfectly

"Tom Ogilvy" wrote:

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

Assuming the textbox is from the control toolbox toolbar as is the
commandbutton.

--
Regards,
Tom Ogilvy


"john tempest" wrote:

is it possible using a command button to copy text from a cell in sheet1 and
paste it into a text box in sheet 2
thankyou john

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default copy to a text box

worksheets("Sheet2").Textbox1.Text = _
worksheets("Sheet2").Textbox1.Text & chr(10) &
Worksheets("Sheet1").Range("B9").Text

--
Regards,
Tom Ogilvy

"john tempest" wrote in message
...
i have a problem
the code worked perfectly,but i want to put in another button to follow on
.i tried this and the text from the first command button was deleted and

the
text from the second commmand button was displayed i need these to follow

on
thank you john

"john tempest" wrote:

thankyou tom that worked perfectly

"Tom Ogilvy" wrote:

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

Assuming the textbox is from the control toolbox toolbar as is the
commandbutton.

--
Regards,
Tom Ogilvy


"john tempest" wrote:

is it possible using a command button to copy text from a cell in

sheet1 and
paste it into a text box in sheet 2
thankyou john





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default copy to a text box

i cannot get that one to run at all,but what i have done is gone down another
path using a normal text box with the following code:
Private Sub CommandButton4_Click()
With Sheet2.Shapes("Text Box 1").TextFrame.Characters
..Text = .Text & " " & Range("A4")
End With
End Sub

i have 20 command buttons and each refers to a cell with text in it. so i
click the button and the text appears in the text box ,this works fine 7
times but then it stops working. i have also tried the following code and
that does exactly the same after 7 times
now i am really confused, any help would be greatly appreciated
thank you john

"Tom Ogilvy" wrote:

worksheets("Sheet2").Textbox1.Text = _
worksheets("Sheet2").Textbox1.Text & chr(10) &
Worksheets("Sheet1").Range("B9").Text

--
Regards,
Tom Ogilvy

"john tempest" wrote in message
...
i have a problem
the code worked perfectly,but i want to put in another button to follow on
.i tried this and the text from the first command button was deleted and

the
text from the second commmand button was displayed i need these to follow

on
thank you john

"john tempest" wrote:

thankyou tom that worked perfectly

"Tom Ogilvy" wrote:

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

Assuming the textbox is from the control toolbox toolbar as is the
commandbutton.

--
Regards,
Tom Ogilvy


"john tempest" wrote:

is it possible using a command button to copy text from a cell in

sheet1 and
paste it into a text box in sheet 2
thankyou john




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
text box insert in Excel - text box lines print on second copy Diana (Berry & Co) Excel Discussion (Misc queries) 0 July 26th 06 04:39 AM
Copy text from Ms Access record to Excel text box [email protected] Excel Programming 0 September 7th 05 05:27 PM
I want to link, not just copy,Word source text to a text box in Ex Carrie K Excel Worksheet Functions 0 August 12th 05 07:58 PM
Search for text, copy the number in front of text w0cyru01 Excel Programming 4 August 3rd 05 05:15 PM
open some txt files ,find text , copy the text before that to a single cell gus Excel Programming 2 July 11th 05 05:40 PM


All times are GMT +1. The time now is 06:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"