Excel Macros: Linking a textbox drawing object to a cell

crackjack

New Member
Joined
Jun 26, 2007
Messages
30
Can I link a textbox to a cell do that the textbox always displays the value in the cell...like writing a formula in the textbox or something? Would be better still if it also reflects the format of the cell, but that's dispensable.

Please help!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
select the textbox as if to enter text
Click in *formula bar* and enter a formula in the normal way.
eg. =A1
 

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 7/27/2007 by Jim May
'

'
ActiveSheet.Shapes("Text Box 1").Select
Selection.Formula = "$A$13"
ActiveCell.Select

End Sub
 

crackjack

New Member
Joined
Jun 26, 2007
Messages
30
Sub Macro3()
ActiveSheet.Shapes("Text Box 1").Select
Selection.Formula = "$A$13"
ActiveCell.Select
End Sub

Thanks! Great! It works.

Strange though that Excel won't let me say
Code:
    ActiveSheet.Shapes("Text Box 1").Formula = "$A$13"
but works fine when I say
Code:
    ActiveSheet.Shapes("Text Box 1").Select
    Selection.Formula = "$A$13"
 

Forum statistics

Threads
1,181,649
Messages
5,931,215
Members
436,784
Latest member
amuljono

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top