Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default text does not update in rectangle box

Hi,
I want to be able to update the text in the rectangle when the user clicks
on it. My code doesn't seem to update the text even though under debugging
mode, I can see it updating.
Pls help.

ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test1 "
MsgBox "ts"
ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test2 "
ActiveCell.Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default text does not update in rectangle box

Hi,

Try it like this:

ActiveSheet.Shapes("Rectangle 1").OLEFormat.Object.Caption="TEST"


--
Hope that helps.

Vergel Adriano


"matelot" wrote:

Hi,
I want to be able to update the text in the rectangle when the user clicks
on it. My code doesn't seem to update the text even though under debugging
mode, I can see it updating.
Pls help.

ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test1 "
MsgBox "ts"
ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test2 "
ActiveCell.Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default text does not update in rectangle box

Didn't work still but I try Corey method and it's good. Thanks.

"Vergel Adriano" wrote:

Hi,

Try it like this:

ActiveSheet.Shapes("Rectangle 1").OLEFormat.Object.Caption="TEST"


--
Hope that helps.

Vergel Adriano


"matelot" wrote:

Hi,
I want to be able to update the text in the rectangle when the user clicks
on it. My code doesn't seem to update the text even though under debugging
mode, I can see it updating.
Pls help.

ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test1 "
MsgBox "ts"
ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test2 "
ActiveCell.Select

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default text does not update in rectangle box

Try something like:

Sub ChangetheTextintheShape()
Dim res As String
With Selection
res = InputBox("What text do you want placed in the Shape?")
Selection.Characters.Text = res
End With
End Sub


"matelot" wrote in message
...
Hi,
I want to be able to update the text in the rectangle when the user clicks
on it. My code doesn't seem to update the text even though under debugging
mode, I can see it updating.
Pls help.

ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test1 "
MsgBox "ts"
ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test2 "
ActiveCell.Select


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default text does not update in rectangle box

Or

Sub ChangetheTextintheShape()
Dim res As String
With ActiveSheet.Shapes("Rectangle 2")
res = InputBox("What text do you want placed in the Shape?")
Selection.Characters.Text = res
End With
End Sub


Will only work with Rectangle 2, but you would need to place a button on the sheet to run it.

Corey....

"Corey" wrote in message ...
Try something like:

Sub ChangetheTextintheShape()
Dim res As String
With Selection
res = InputBox("What text do you want placed in the Shape?")
Selection.Characters.Text = res
End With
End Sub


"matelot" wrote in message
...
Hi,
I want to be able to update the text in the rectangle when the user clicks
on it. My code doesn't seem to update the text even though under debugging
mode, I can see it updating.
Pls help.

ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test1 "
MsgBox "ts"
ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test2 "
ActiveCell.Select





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default text does not update in rectangle box

That works. Thanks.

"Corey" wrote:

Try something like:

Sub ChangetheTextintheShape()
Dim res As String
With Selection
res = InputBox("What text do you want placed in the Shape?")
Selection.Characters.Text = res
End With
End Sub


"matelot" wrote in message
...
Hi,
I want to be able to update the text in the rectangle when the user clicks
on it. My code doesn't seem to update the text even though under debugging
mode, I can see it updating.
Pls help.

ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test1 "
MsgBox "ts"
ActiveSheet.Shapes("Rectangle 2").Select
Selection.Characters.Text = "test2 "
ActiveCell.Select



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
Assign a text to a rectangle Alberto Ast[_2_] Excel Discussion (Misc queries) 6 September 19th 09 06:40 AM
Text Box vs. rectangle, what is the difference? Tonso Excel Discussion (Misc queries) 1 April 8th 09 02:43 PM
Change text in rectangle shape Tom Ogilvy Excel Programming 0 January 23rd 07 01:03 AM
Change text in rectangle shape Don Guillett Excel Programming 0 January 22nd 07 11:54 PM
Add text to a rectangle in VBA pk Excel Programming 2 October 19th 03 02:44 AM


All times are GMT +1. The time now is 03:01 PM.

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"