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


Hi,
I trying to create a command button, that changes part of it's tex
based on the value of a single cell named range ("InvInvoice"). I hav
tried entering a formula into the Caption property, but couldn't mak
it work.
I then tried grouping a command button and a text box together and i
works, but because the text on the command button centers itself,
have to oversize the command button to make room for the textbox. I
looks klunky.
The static text is "Save and File Invoice #" and the changing text i
the invoice number located in the named range.
Any ideas

--
Case

-----------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...nfo&userid=454
View this thread: http://www.excelforum.com/showthread.php?threadid=52274

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Command Button design question

You could use an event that looks for a change to that range and adjusts the
caption of that commandbutton's (from the Control toolbox toolbar).

Or ....

You could use a button from the forms toolbar and a helper cell.

I put:
="Save and File Invoice #" & text(InvVoice,"00000")
in a cell (say A1)

Then I added a button from the forms toolbar (and assigned the macro to that
button)

But with the button selected, I put
=a1
in the formula bar.

Buttons from the forms toolbar have a lot fewer features compared to the
commandbuttons from the control toolbox toolbar.


If your InvVoice cell changes because of a typing change, you could use
something like:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("InvVoice")) Is Nothing Then Exit Sub

Me.CommandButton1.Caption _
= "Save and File Invoice #" & Format(Target.Value, "00000")

End Sub



Casey wrote:

Hi,
I trying to create a command button, that changes part of it's text
based on the value of a single cell named range ("InvInvoice"). I have
tried entering a formula into the Caption property, but couldn't make
it work.
I then tried grouping a command button and a text box together and it
works, but because the text on the command button centers itself, I
have to oversize the command button to make room for the textbox. It
looks klunky.
The static text is "Save and File Invoice #" and the changing text is
the invoice number located in the named range.
Any ideas?

--
Casey

------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=522740


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command Button design question


Dave,
Two options, thanks, and your preception is correct the Invoice
changes by manual entry so I'm using the Worksheet change event and th
commandbutton from the control toolbar.
I know you post so often, helping people like me, no way you coul
remember everbody you help, but I remember and I know we are into th
double digits with the number of answers I've received from you.
If you ever go skiing in Aspen (I live in Carbondale very close by)
e-mail me, I owe you a steak dinner at least

--
Case

-----------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...nfo&userid=454
View this thread: http://www.excelforum.com/showthread.php?threadid=52274

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Command Button design question

Thanks for the offer. I like the steak -- never skied though.



Casey wrote:

Dave,
Two options, thanks, and your preception is correct the Invoice #
changes by manual entry so I'm using the Worksheet change event and the
commandbutton from the control toolbar.
I know you post so often, helping people like me, no way you could
remember everbody you help, but I remember and I know we are into the
double digits with the number of answers I've received from you.
If you ever go skiing in Aspen (I live in Carbondale very close by),
e-mail me, I owe you a steak dinner at least.

--
Casey

------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=522740


--

Dave Peterson
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
command buttons in design mode Leeo Excel Discussion (Misc queries) 5 June 10th 08 12:33 PM
Command Button question Giselle[_2_] Excel Programming 7 January 28th 06 03:20 AM
command button question Gary Keramidas[_2_] Excel Programming 4 June 18th 05 08:24 PM
2 part question - macro / command button John Excel Discussion (Misc queries) 3 April 16th 05 09:00 PM
Command Button Question Todd D. Levy Excel Programming 4 July 7th 04 03:18 PM


All times are GMT +1. The time now is 10:07 AM.

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

About Us

"It's about Microsoft Excel"