Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform to input some data. After the user presses the "enter"
button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What about doing it the standard way and use the Status Bar?
StatusBarStatus = Application.DisplayStatusBar Application.DisplayStatusBar = True Application.StatusBar = "Processing... please wait" ' ' Your code goes here ' Application.StatusBar = False Application.DisplayStatusBar = StatusBarStatus -- Rick (MVP - Excel) "David Gerstman" wrote in message ... I have a userform to input some data. After the user presses the "enter" button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nice and easy
Private Sub CommandButton1_Click() With Label1 .Caption = "Saving..." .ForeColor = &HFF& End With End Sub "Rick Rothstein" wrote: What about doing it the standard way and use the Status Bar? StatusBarStatus = Application.DisplayStatusBar Application.DisplayStatusBar = True Application.StatusBar = "Processing... please wait" ' ' Your code goes here ' Application.StatusBar = False Application.DisplayStatusBar = StatusBarStatus -- Rick (MVP - Excel) "David Gerstman" wrote in message ... I have a userform to input some data. After the user presses the "enter" button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jeff,
This accomplishes half of what I want. If I want the "Saving ..." message to appear for a limited time, say a second or two, is there some way to do that? Thank you, David "Jeff" wrote: Nice and easy Private Sub CommandButton1_Click() With Label1 .Caption = "Saving..." .ForeColor = &HFF& End With End Sub "Rick Rothstein" wrote: What about doing it the standard way and use the Status Bar? StatusBarStatus = Application.DisplayStatusBar Application.DisplayStatusBar = True Application.StatusBar = "Processing... please wait" ' ' Your code goes here ' Application.StatusBar = False Application.DisplayStatusBar = StatusBarStatus -- Rick (MVP - Excel) "David Gerstman" wrote in message ... I have a userform to input some data. After the user presses the "enter" button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In Short? yes. The trouble is that you may be sacrificing performance for
convenience. I suggest placing my previous post at the beginning of the Button_Click event and return the original properties at the end. Something like this; Sub CommandButton1_Click() With Label1 .Caption = "Saving..." .ForeColor = &HFF& End With €˜Your Code here With Label1 .Caption = "Save€ .ForeColor = &H80000012 End With End Sub This way youre only adding a few lines of code and not having any unnecessary waiting You get youre message across for as long as it needed and thats it. "David Gerstman" wrote: Jeff, This accomplishes half of what I want. If I want the "Saving ..." message to appear for a limited time, say a second or two, is there some way to do that? Thank you, David "Jeff" wrote: Nice and easy Private Sub CommandButton1_Click() With Label1 .Caption = "Saving..." .ForeColor = &HFF& End With End Sub "Rick Rothstein" wrote: What about doing it the standard way and use the Status Bar? StatusBarStatus = Application.DisplayStatusBar Application.DisplayStatusBar = True Application.StatusBar = "Processing... please wait" ' ' Your code goes here ' Application.StatusBar = False Application.DisplayStatusBar = StatusBarStatus -- Rick (MVP - Excel) "David Gerstman" wrote in message ... I have a userform to input some data. After the user presses the "enter" button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Two things... First, I would use an ActiveX Label control and pre-set it up
(by sizing it, its font, its back and fore colors), then set its Visible property to False, and then have your code make it visible before you start your existing code and invisible once your existing code is finished. Second, if using a Label, you will need to examine where to locate it in case the user scrolls the worksheet (so that the Label is scrolled off-screen). I think a construction like this can handle both of these points... Dim Obj As OLEObject With Worksheets("Sheet4").OLEObjects("Label1") .Top = Rows(ActiveWindow.ScrollRow).Top + _ ActiveWindow.Height / 2 - .Height .Left = Columns(ActiveWindow.ScrollColumn).Left + _ ActiveWindow.Width / 2 - .Width / 2 .Visible = True ' ' << Your code goes here ' .Visible = False End With -- Rick (MVP - Excel) "David Gerstman" wrote in message ... Jeff, This accomplishes half of what I want. If I want the "Saving ..." message to appear for a limited time, say a second or two, is there some way to do that? Thank you, David "Jeff" wrote: Nice and easy Private Sub CommandButton1_Click() With Label1 .Caption = "Saving..." .ForeColor = &HFF& End With End Sub "Rick Rothstein" wrote: What about doing it the standard way and use the Status Bar? StatusBarStatus = Application.DisplayStatusBar Application.DisplayStatusBar = True Application.StatusBar = "Processing... please wait" ' ' Your code goes here ' Application.StatusBar = False Application.DisplayStatusBar = StatusBarStatus -- Rick (MVP - Excel) "David Gerstman" wrote in message ... I have a userform to input some data. After the user presses the "enter" button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
There are many ways of doing this and here's one. Put these few lines of code at the start of you 'Enter Button' code and you get a messagebox that stays there for 3 seconds or until the user presses a button. Change the time delay and message to suit your needs. Dim Msg As String Dim Secs As Long Dim Wsh As Object Title = "User Message" Msg = "Saving data." Secs = 3 Set Wsh = CreateObject("WScript.Shell") RetVal = Wsh.Popup(Msg, Secs, Title, vbInformation + vbOKCancel) Set Wsh = Nothing Mike "David Gerstman" wrote: I have a userform to input some data. After the user presses the "enter" button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Set up you userform with a lable which in my exaple is named Label1. In the properties for the label enter the desired message in "Caption", set ForeColor to red and Visible =False. Private Sub CommandButton1_Click() Me.Label1.Visible = True newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 2' Change number to change visible time waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Me.Hide Unload Me End Sub Regards, Per "David Gerstman" skrev i meddelelsen ... I have a userform to input some data. After the user presses the "enter" button, the data is recorded. I've been asked to have an indicator that flashes for a moment to indicate that information is being saved. I was thinking of having text in a label that would say "SAVING..." in red letters for a second or two. How would I accomplish that? Thank you, David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Notification | Excel Discussion (Misc queries) | |||
Notification | Excel Worksheet Functions | |||
Automatic Notification | Excel Discussion (Misc queries) | |||
Notification | Excel Programming | |||
Email notification | Excel Programming |