Button's Text Value

  • Thread starter Thread starter ianripping
  • Start date Start date
I

ianripping

I got this from an old post: -

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim invent_index As Integer
On Error GoTo CleanUp
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub

With Target
Application.EnableEvents = False
Link_Button.Caption = .Value
End With

CleanUp:
Application.EnableEvents = True
End Sub

This should update the text in a shape as long as:-

Shape Name = 'Link_Button"
and...
Name is entered in "A1"

I've tried to get it to work bur it won't!
I think its to what the name "refers to?".

Help
 
Ian,

Have you changed the button's name property to Link_Button, that is the one
in the VBE properties sheet for the button, not the one in the names box on
the Excel worksheet?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Go into design mode, select the button, and then go into the VBE. Select
the appropriate worksheet and the combobox properties will appear, and you
should see that the name is still ComboBox1. Change it to your name.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Ok I have managed to change the name to Link_Button and it still won
work!

Could you build me an example for download. Anyone
 
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Alt-F11.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Ian,

Just FYI. Most of us access these NGs directly from the MS News Server,
unlike you at ExcelForum. As such, we don't have the capability to post an
example to that board unless we join which offers little incentive. It won't
always work, but in circumstances like this it might be best to offer an
email address to send to - with the mandatory spam-proofing of course.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top