Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Text Box Value

Two Possible answers to this one that will solve my problem... one from
Excel, one from VBA.

From Excel, is there a formula that will link a cell to a text box value?
-- If the value of "TextBox1" is "Test", is there a way to send this value
to cell A1.

From VBA, how do you refer to a text box from VBA?
-- I tried Sheets("Survey").TextBox(tbox) where tbox is a string with the
TextBox's name ("TextBox1" which changes with each text box). This returns an
error.

Thanks for your help :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Text Box Value

I figured out how to select the textbox using...
Sheets("Survey").Shapes("TextBox1").Select

and how to change the text in the box...
Sheets("Survey").Shapes("Text Box 125").Characters.Text = "test"

But how do I pull the value from the box...

"jayklmno" wrote:

Two Possible answers to this one that will solve my problem... one from
Excel, one from VBA.

From Excel, is there a formula that will link a cell to a text box value?
-- If the value of "TextBox1" is "Test", is there a way to send this value
to cell A1.

From VBA, how do you refer to a text box from VBA?
-- I tried Sheets("Survey").TextBox(tbox) where tbox is a string with the
TextBox's name ("TextBox1" which changes with each text box). This returns an
error.

Thanks for your help :)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Text Box Value

abc = Sheets("Survey").Shapes("Text Box 125").Characters.Text

"jayklmno" wrote:

I figured out how to select the textbox using...
Sheets("Survey").Shapes("TextBox1").Select

and how to change the text in the box...
Sheets("Survey").Shapes("Text Box 125").Characters.Text = "test"

But how do I pull the value from the box...

"jayklmno" wrote:

Two Possible answers to this one that will solve my problem... one from
Excel, one from VBA.

From Excel, is there a formula that will link a cell to a text box value?
-- If the value of "TextBox1" is "Test", is there a way to send this value
to cell A1.

From VBA, how do you refer to a text box from VBA?
-- I tried Sheets("Survey").TextBox(tbox) where tbox is a string with the
TextBox's name ("TextBox1" which changes with each text box). This returns an
error.

Thanks for your help :)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Text Box Value

That returns a "Run-Time Error 438: Object doesn't support this property or
method"

"Joel" wrote:

abc = Sheets("Survey").Shapes("Text Box 125").Characters.Text

"jayklmno" wrote:

I figured out how to select the textbox using...
Sheets("Survey").Shapes("TextBox1").Select

and how to change the text in the box...
Sheets("Survey").Shapes("Text Box 125").Characters.Text = "test"

But how do I pull the value from the box...

"jayklmno" wrote:

Two Possible answers to this one that will solve my problem... one from
Excel, one from VBA.

From Excel, is there a formula that will link a cell to a text box value?
-- If the value of "TextBox1" is "Test", is there a way to send this value
to cell A1.

From VBA, how do you refer to a text box from VBA?
-- I tried Sheets("Survey").TextBox(tbox) where tbox is a string with the
TextBox's name ("TextBox1" which changes with each text box). This returns an
error.

Thanks for your help :)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Text Box Value

Shoot me...

You have to use DrawingObjects

abc = Sheets("Survey").DrawingObjects("Text Box 125").Characters.Text



"jayklmno" wrote:

That returns a "Run-Time Error 438: Object doesn't support this property or
method"

"Joel" wrote:

abc = Sheets("Survey").Shapes("Text Box 125").Characters.Text

"jayklmno" wrote:

I figured out how to select the textbox using...
Sheets("Survey").Shapes("TextBox1").Select

and how to change the text in the box...
Sheets("Survey").Shapes("Text Box 125").Characters.Text = "test"

But how do I pull the value from the box...

"jayklmno" wrote:

Two Possible answers to this one that will solve my problem... one from
Excel, one from VBA.

From Excel, is there a formula that will link a cell to a text box value?
-- If the value of "TextBox1" is "Test", is there a way to send this value
to cell A1.

From VBA, how do you refer to a text box from VBA?
-- I tried Sheets("Survey").TextBox(tbox) where tbox is a string with the
TextBox's name ("TextBox1" which changes with each text box). This returns an
error.

Thanks for your help :)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Text Box Value

Demo'd from the immediate window (for textboxes from the drawing toolbar).
? activesheet.Textboxes("Text Box 1").Text
abcdefgh

Range("A1").Value = activesheet.Textboxes("Text Box 1").Text
? range("A1").Value
abcdefgh
Activesheet.Textboxes("Text Box 1").Text = " Why Hello there!"
? Activesheet.Textboxes("Text Box 1").Text & " " & Range("A1").Value
Why Hello there! abcdefgh

Manually, select the textbox

go to the formula bar and put in

=A1<enter

Now they are linked.



--
Regards,
Tom Ogilvy

"jayklmno" wrote:

Shoot me...

You have to use DrawingObjects

abc = Sheets("Survey").DrawingObjects("Text Box 125").Characters.Text



"jayklmno" wrote:

That returns a "Run-Time Error 438: Object doesn't support this property or
method"

"Joel" wrote:

abc = Sheets("Survey").Shapes("Text Box 125").Characters.Text

"jayklmno" wrote:

I figured out how to select the textbox using...
Sheets("Survey").Shapes("TextBox1").Select

and how to change the text in the box...
Sheets("Survey").Shapes("Text Box 125").Characters.Text = "test"

But how do I pull the value from the box...

"jayklmno" wrote:

Two Possible answers to this one that will solve my problem... one from
Excel, one from VBA.

From Excel, is there a formula that will link a cell to a text box value?
-- If the value of "TextBox1" is "Test", is there a way to send this value
to cell A1.

From VBA, how do you refer to a text box from VBA?
-- I tried Sheets("Survey").TextBox(tbox) where tbox is a string with the
TextBox's name ("TextBox1" which changes with each text box). This returns an
error.

Thanks for your help :)

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
Using TEXT and &TEXT - display numbers with commas, underline text Gary Excel Discussion (Misc queries) 3 May 5th 23 03:46 AM
Text does not display in "Text boxs" and when wrapping text in a c Esteban Excel Discussion (Misc queries) 1 March 8th 07 11:59 PM
select text in cell based on text from another cell, paste the text at the begining of a thrid cell, etc... jsd219 Excel Programming 0 October 19th 06 05:04 PM
Excel VBA: Worksheet cell .Text property: 1024 bytes text len limit loyso Excel Programming 7 May 3rd 05 02:51 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 10:24 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"