Linking Textbox and cell
Hi Toppers,
Thanks for your reply.
Put the code in worksheet "C1" where the text-entry cell is a merged cell,
M7. The target Textbox is "Textbox1" in worksheet named "Strategy Map".
When typing text in M7, nothing changes in the Textbox. Is the merged cell
the problem? No error messages. I need this to work any time the user makes
an entry in M7.
Here is how I modified the code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Errorhandler
If Target.Address = "$M$7" Then
Application.EnableEvents = False
Worksheets("Strategy Map").TextBox1.Value = Target.Value
End If
Errorhandler:
Application.EnableEvents = True
End Sub
Thanks, Phil
"Toppers" wrote:
Hi,
This assumes entry cell (A1) is in Sheet2 and textbox on Sheet1. Change
these as required
Add this code to Sheet2 by right clicking on sheet tab and selecting "view
code".
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Errorhandler
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Worksheets("Sheet1").TextBox1.Value = Target.Value
End If
Errorhandler:
Application.EnableEvents = True
End Sub
HTH
"Phil Hageman" wrote:
Is there a way to link a Textbox in one worksheet to a cell in another
worksheet, such that text entered in the cell automatically appears in the
Textbox?
|