Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default changing the caption of a command button

I have a command button that when clicked runs a VB script that carries out a
complex calculation. Right now, the caption for the button reads,
"Calculate".

I'd like it to switch to read, "Working" while it is doing the calculating
and then back to "Calculate" when it's done.

If I enter Me.CommandButton1.Caption = "Working" at the beginning of the
script, it doesn't change. Probably not refreshing.

Is there a way to get it to change while it's calculating?

Thanks in advance.

Jerry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default changing the caption of a command button

Based on your code I assume that the button comes from the Control Toolbox.
Is screen updating on or off? I assume that the button is embedded in the
sheet.

Instead of using me. have you tired referencing the sheet directly like

Sheet1.CommandButton1.Caption = "Working"

As a complete aside I tend to use the status bar to preform this function
instead of changing button captions. It is a little less of a problem to
reset if things go wrong...

Application.statusbar = "Calculating. Please Wait..."
'Your code
application.statusbar = false

--
HTH...

Jim Thomlinson


"JWCrosby" wrote:

I have a command button that when clicked runs a VB script that carries out a
complex calculation. Right now, the caption for the button reads,
"Calculate".

I'd like it to switch to read, "Working" while it is doing the calculating
and then back to "Calculate" when it's done.

If I enter Me.CommandButton1.Caption = "Working" at the beginning of the
script, it doesn't change. Probably not refreshing.

Is there a way to get it to change while it's calculating?

Thanks in advance.

Jerry

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default changing the caption of a command button

Thanks, Jim. That's a simpler, yet just as effective, method.

Jerry

"Jim Thomlinson" wrote:

Based on your code I assume that the button comes from the Control Toolbox.
Is screen updating on or off? I assume that the button is embedded in the
sheet.

Instead of using me. have you tired referencing the sheet directly like

Sheet1.CommandButton1.Caption = "Working"

As a complete aside I tend to use the status bar to preform this function
instead of changing button captions. It is a little less of a problem to
reset if things go wrong...

Application.statusbar = "Calculating. Please Wait..."
'Your code
application.statusbar = false

--
HTH...

Jim Thomlinson


"JWCrosby" wrote:

I have a command button that when clicked runs a VB script that carries out a
complex calculation. Right now, the caption for the button reads,
"Calculate".

I'd like it to switch to read, "Working" while it is doing the calculating
and then back to "Calculate" when it's done.

If I enter Me.CommandButton1.Caption = "Working" at the beginning of the
script, it doesn't change. Probably not refreshing.

Is there a way to get it to change while it's calculating?

Thanks in advance.

Jerry

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 Button Caption Qaspec Excel Programming 1 January 27th 05 03:30 PM
Change Caption of Forms Command Button No Name Excel Programming 9 December 10th 04 07:59 AM
Label - Caption not changing Brian Hribek[_2_] Excel Programming 0 October 11th 04 10:02 PM
Caption of a button Dr_Phil Excel Programming 4 May 4th 04 09:13 PM
Urgent: VBA Command Button Caption Problem Disco[_4_] Excel Programming 1 November 12th 03 10:38 AM


All times are GMT +1. The time now is 07:22 PM.

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"