ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA text Box (https://www.excelbanter.com/excel-discussion-misc-queries/218789-vba-text-box.html)

Soccer boy[_2_]

VBA text Box
 
is it possible to have a textbox that will automatically update with a value
as the spreadsheets are updated.
In the textbox i am setting the text equal to a cell, but the textbox is
still showing the same. it is like it doesnt recognize what i am trying to
do. is their another way of doing this

it is currently showing 220
however in the textbox i set the text = 'Sheet 1'!$A$12
which should give it a value of 334 i do not know where it is getting 220
from. Please Help

Gary''s Student

VBA text Box
 
First I inserted a textbox from the Drawing Toolbar

and then in the worksheet code area:

Private Sub Worksheet_Calculate()
Set r = Selection
ActiveSheet.Shapes("Text Box 1").Select
Selection.Characters.Text = Sheets("Sheet1").Range("A12").Value
r.Select
End Sub

Finally in A12, I put:
=NOW()
--
Gary''s Student - gsnu200830


"Soccer boy" wrote:

is it possible to have a textbox that will automatically update with a value
as the spreadsheets are updated.
In the textbox i am setting the text equal to a cell, but the textbox is
still showing the same. it is like it doesnt recognize what i am trying to
do. is their another way of doing this

it is currently showing 220
however in the textbox i set the text = 'Sheet 1'!$A$12
which should give it a value of 334 i do not know where it is getting 220
from. Please Help



All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com