ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User defined functions (https://www.excelbanter.com/excel-programming/311725-user-defined-functions.html)

big t

User defined functions
 
Hi everyone,

just a quickie - i'm pretty sure the answer is no but I just wanted to get
it confirmed by one of the gurus here - my question is:

can i write messages to the statusbar from a user defined function?

i've tried it and it doesn't seem to do anything, but it doesn't cause an
error either.

TIA
big t


Ron Rosenfeld

User defined functions
 
On Tue, 28 Sep 2004 08:19:07 -0700, "big t"
wrote:

Hi everyone,

just a quickie - i'm pretty sure the answer is no but I just wanted to get
it confirmed by one of the gurus here - my question is:

can i write messages to the statusbar from a user defined function?

i've tried it and it doesn't seem to do anything, but it doesn't cause an
error either.

TIA
big t


Yes, you can.

Look at VBA HELP for the StatusBar Property.


Here's a code snippet from one of my routines. In this case, 's' is a double
representing file size:

========================
....
oldStatusBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Application.StatusBar = "Copying File..." & Format(s/1024/1000, "0.00") & "MB"
....
====================


--ron

big t

User defined functions
 
Thanks for the info Ron.

I just wanted to confirm - do you do this from a user defined function? I
copied your code into one of my functions (having changed the text to be
displayed in the statusbar) but I don't get anything in my Statusbar.

Any ideas?

TIA
big t


"Ron Rosenfeld" wrote:

On Tue, 28 Sep 2004 08:19:07 -0700, "big t"
wrote:

Hi everyone,

just a quickie - i'm pretty sure the answer is no but I just wanted to get
it confirmed by one of the gurus here - my question is:

can i write messages to the statusbar from a user defined function?

i've tried it and it doesn't seem to do anything, but it doesn't cause an
error either.

TIA
big t


Yes, you can.

Look at VBA HELP for the StatusBar Property.


Here's a code snippet from one of my routines. In this case, 's' is a double
representing file size:

========================
....
oldStatusBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Application.StatusBar = "Copying File..." & Format(s/1024/1000, "0.00") & "MB"
....
====================


--ron


Ron Rosenfeld

User defined functions
 
On Wed, 29 Sep 2004 01:09:03 -0700, "big t"
wrote:

Thanks for the info Ron.

I just wanted to confirm - do you do this from a user defined function? I
copied your code into one of my functions (having changed the text to be
displayed in the statusbar) but I don't get anything in my Statusbar.

Any ideas?


Ah I missed that nuance. No I do not do it from a function; I do it from a
sub.

I believe that a function can only return a value to the cell in which it
exists, and cannot influence other parts of the Excel environment.


--ron


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com