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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
select the textbox as if to enter text
Click in *formula bar* and enter a formula in the normal way.
eg. =A1
 
Upvote 0
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
 
Upvote 0
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"
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,215
Members
448,874
Latest member
b1step2far

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
Back
Top