Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Edit Text in Button

Is it possible to link the text in a button, to a cell?


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Edit Text in Button

Only programmatically, that is you would need to do it all.

--

HTH

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

"ianripping " wrote in message
...
Is it possible to link the text in a button, to a cell?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Edit Text in Button

How do you mean

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Edit Text in Button

Hi
one way would be (if you have placed the button on a worksheet) to use
the worksheet_change event. The following code makes the assumptions:
- that your command butto is named 'Link_Button'
- the linked cell is A1

HTH
Frank

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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Edit Text in Button

Like that <G

--

HTH

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

"Frank Kabel" wrote in message
...
Hi
one way would be (if you have placed the button on a worksheet) to use
the worksheet_change event. The following code makes the assumptions:
- that your command butto is named 'Link_Button'
- the linked cell is A1

HTH
Frank

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







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Edit Text in Button

Bob Phillips wrote:
Like that <G

Thanks but I still wonder why one wants to link the Button caption to a
cell. Maybe the OP will enlighten me ;-)

Frank

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Edit Text in Button

Pre-supposing the OP, but I think I can semi-understand it. If the sheet
gets regular updates, either automatically or by manual change, it is quite
possible that a button text may be helpful. The text could even be tested in
the macro to determine the action taken (although that could just as easily
be the cell value itself). The one thing we don't always get is a full
requirement, so we produce specific answers, which of course may not be the
best solutions.

--

HTH

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

"Frank Kabel" wrote in message
...
Bob Phillips wrote:
Like that <G

Thanks but I still wonder why one wants to link the Button caption to a
cell. Maybe the OP will enlighten me ;-)

Frank



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ho to edit text in a custom button donwb Excel Discussion (Misc queries) 3 September 20th 09 08:37 PM
Macro to edit button tkincaid Excel Worksheet Functions 2 January 7th 09 12:45 PM
edit configure add button and code [email protected] uk Excel Discussion (Misc queries) 2 November 23rd 08 10:26 AM
how can I restore Edit button to the Formula bar? JJKatty Excel Discussion (Misc queries) 3 March 26th 05 05:25 AM
How to edit the size and make it bold of the Option Button text? Cammie Excel Discussion (Misc queries) 1 February 23rd 05 01:57 AM


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"