Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheetfunctions,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Filling a textbox with text in another cell

Hi

I wonder if someone can help me. I am using Excel 97 and I've got a
textbox on the worksheet that I want to be filled with information on a
cell on another sheet. How would I reference this in VBA so that the
textbox was updated every time the sheet was activated?

I had looked on the web and found one way to do it, but it was a textbox
from the Drawing menu not the Control Toolbox menu, and it didn't have
scroll bars, which it needs to have.

So, I've got in VBA:

txtMessages.Text =

but I don't know how to reference the cell.

Thanks in advance.
--
Charles
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default Filling a textbox with text in another cell

Hi Charles

You may not need VB code. Place your cursor in the text box and then
activate the formula bar. Type "=" in the formula bar and then activate the
relevant cell on the worksheet you want the text box linked to.

If you want to use code, place the following in the relevant worksheet
module

Private Sub Worksheet_Activate()
Sheets("Sheet1").Shapes("Text Box 2").TextFrame.Characters.Text = _
Sheets("Sheet2").Range("B5")
End Sub

Untested in XL 97, tested in XL 2002


--
XL2002
Regards

William



"Charles" wrote in message
...
| Hi
|
| I wonder if someone can help me. I am using Excel 97 and I've got a
| textbox on the worksheet that I want to be filled with information on a
| cell on another sheet. How would I reference this in VBA so that the
| textbox was updated every time the sheet was activated?
|
| I had looked on the web and found one way to do it, but it was a textbox
| from the Drawing menu not the Control Toolbox menu, and it didn't have
| scroll bars, which it needs to have.
|
| So, I've got in VBA:
|
| txtMessages.Text =
|
| but I don't know how to reference the cell.
|
| Thanks in advance.
| --
| Charles



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default Filling a textbox with text in another cell

Ignore my post, it relates to a text box from the Drawing toolbar. Sorry

--
XL2002
Regards

William



"William" wrote in message
...
| Hi Charles
|
| You may not need VB code. Place your cursor in the text box and then
| activate the formula bar. Type "=" in the formula bar and then activate
the
| relevant cell on the worksheet you want the text box linked to.
|
| If you want to use code, place the following in the relevant worksheet
| module
|
| Private Sub Worksheet_Activate()
| Sheets("Sheet1").Shapes("Text Box 2").TextFrame.Characters.Text = _
| Sheets("Sheet2").Range("B5")
| End Sub
|
| Untested in XL 97, tested in XL 2002
|
|
| --
| XL2002
| Regards
|
| William
|
|

|
| "Charles" wrote in message
| ...
| | Hi
| |
| | I wonder if someone can help me. I am using Excel 97 and I've got a
| | textbox on the worksheet that I want to be filled with information on a
| | cell on another sheet. How would I reference this in VBA so that the
| | textbox was updated every time the sheet was activated?
| |
| | I had looked on the web and found one way to do it, but it was a textbox
| | from the Drawing menu not the Control Toolbox menu, and it didn't have
| | scroll bars, which it needs to have.
| |
| | So, I've got in VBA:
| |
| | txtMessages.Text =
| |
| | but I don't know how to reference the cell.
| |
| | Thanks in advance.
| | --
| | Charles
|
|
|


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
Filling Text from Another File lost in charts Excel Worksheet Functions 6 December 2nd 05 07:46 PM
filling information from one cell and filling another. Dianne Excel Worksheet Functions 1 August 15th 05 08:14 PM
Copy range Cell text and font properties to a Textbox BC[_3_] Excel Programming 3 March 3rd 04 07:32 PM
Searching a text and filling a cell with the result pauloterra Excel Programming 3 January 19th 04 01:20 PM
check variable(text) with cell (text), textbox Mark[_17_] Excel Programming 1 August 27th 03 01:15 PM


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

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

About Us

"It's about Microsoft Excel"