Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ernesta Fernandez   on Nov 18 In MS Office Category.

  
Question Answered By: Sherrie Thomas   on Nov 18

Assuming you have a textbox  called textbox1 which should be equal to cell  A1
and that it is a control (rather than a drawing object).

TextBox1_Change() is the name of a macro which is run each time the user
makes a change to the text box.
TextBox1.Value is the content of the box

So if you want to make the text box equal to cell A1 you would use

TextBox1.Value= Worksheets("Sheet1").Range("A1").Value

You might put that line in a macro called when the sheet is changed.
That macro, in the Sheet1 object starts
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

You would then need to test the target to see if its address was "A1" before
running the code.

However there is an easier way
-----------------------------------------
In the properties of the text box there is a setting for LinkedCell. If
that is set  to A1 the text box will always contain the same value as A1.
Change the text box and the cell will change, change the cell and the
textbox will change.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Coding textboxes Or get search suggestion and latest updates.


Tagged: