Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default return textfrom cell into textbutton/commandbutton

Hello
This is what I "feared".
I would personnaly rather recommend you use one of the controls tool box
items instead.
As it will be definitely easier for you to access its properties (Value or
Caption for instance).
In the sample code I provided previously you will note that I am using the
key word "Me" which identifies the worksheet since you are dealing with this
object class when you are in the Worksheet code (right-clicking on the
worksheet tab and selecting view code brings you there)
Using this method will automatically provide access to any property or
object related to the worksheet using the dot (.)
Thus if you have previoulsy created a commandbutton for example (from the
controls tool box) and by default its name will be CommandButton1, if you
use the word Me followed by the dot (ie: Me.) then you will have a pop up
list with all the available items among which you will find the object
"CommandButton1".
Hope this helps you get on further.

Cordially
Pascal


"Jonsson" a écrit dans le message de
...
Forms Toolbar

//Thomas
"papou" skrev i meddelandet
...
Where did you get the "textbutton" from:
Forms tool bar
Controls Tool Box
?
Cordially
Pascal

"Jonsson" a écrit dans le message de
...
Hi Pascal

Thanks for your answer.

I'm sure the code is okay, but is it something I have to do to get the

code
working in my application.
It seems to be some problem, because the macro wont work for me.
My button is'nt a commandButton, it's a textbutton (hope you know what

I
mean). Could that be the problem?

"papou" skrev i meddelandet
...
Hello
Place this in the sheet's code and amend accordingly:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$15" And Target.Value < "" Then
Me.CommandButton1.Caption = Target.Value
End If
End Sub

HTH
Cordially
Pascal

"Jonsson" a écrit dans le message de
...
Hi all,

Is it possible to return a textvalue from a cell into a
textbutton/commandbutton so that the text in the button changes
depending
of
what you write in the cell?
If so, how to do it?

Any help is apprecciated!!

//Thomas












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
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
CommandButton Alvin Hansen[_2_] Excel Programming 3 August 16th 04 06:35 PM
CommandButton chris[_12_] Excel Programming 1 April 15th 04 01:01 AM
CommandButton rwebster3 Excel Programming 0 April 14th 04 08:16 PM
Commandbutton David Fixemer Excel Programming 2 February 25th 04 10:18 PM


All times are GMT +1. The time now is 08:01 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"