Application StatusBar

Steve001

Board Regular
Joined
Apr 13, 2017
Messages
55
Morning All,

The status bar looks like it is in two halves ? or am i wrong (i can see a dividing line)

I can put a message in the first part by
Application.StatusBar = ("Updating Sheet Data Please Wait")

i am wanting to put a status of something in the second half is this possible how?

Can somebody please advise

PS please put comments in the code - still learning


Regards

Steve
 

Steve001

Board Regular
Joined
Apr 13, 2017
Messages
55
:edit blonde moment :eek: just realised the area i was looking at displays messages from excel ie "save file as ..."
Can i still populate this area with a status message with ease ?
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
4,288
Can I still populate this area with a status message with ease ?
Yes
Paste attached into a module and run from any sheet. Observe status bar.

Code:
Sub StatusBarMessages()
'capture original value
    Dim oldStatusBar:  oldStatusBar = Application.DisplayStatusBar

'doing things and updating the status bar
    Application.StatusBar = "Adding data..."
        Application.Wait (Now + TimeValue("00:00:02"))  'dummy VBA action
        
    Application.StatusBar = "30% complete, sorting data ..."
        Application.Wait (Now + TimeValue("00:00:05"))
    
    Application.StatusBar = "85% complete , exporting data ..."
        Application.Wait (Now + TimeValue("00:00:05"))
    
'reset to riginal value
    Application.StatusBar = False: Application.DisplayStatusBar = oldStatusBar
End Sub
 

Steve001

Board Regular
Joined
Apr 13, 2017
Messages
55
Hi Yongle,

Thank you for your reply, I ant ting to put a message in the area to the right of the status bar.
Is this possible?

Steve
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
4,288
I think the usable space is all on the left. But I can see this very long string on my screen :eek:
Code:
 Application.StatusBar = "abcdefghijklmnopqrstuvwxyz0123456789....ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789....abcdefghijklmnopqrstuvwxyz0123456789....ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789...."
 

Steve001

Board Regular
Joined
Apr 13, 2017
Messages
55
Thank you,

I have managed to do it with a bit of "fudge" factor, a blank string of twenty spaces then another string with my message for status.

Steve
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
4,288
That is not a "fudge" - it is more making the best of an Excel limit in an "ugly" manner :LOL:
But you could make it look less ugly like this
Code:
Application.StatusBar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ " & String(20, " ") & "abcdefghijklmnopqrstuvwxyz"
 
Last edited:

Steve001

Board Regular
Joined
Apr 13, 2017
Messages
55
Hi Yongle,

Thank you again
:)

i like this >
String(20, " ")

I had set a string called space = " "(20 spaces in it)

and used this within my messages

Steve
 
Last edited:

Forum statistics

Threads
1,078,447
Messages
5,340,345
Members
399,370
Latest member
salamon

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top