PDA

View Full Version : Need VBA coding help for status bar and screenupdating



maylindler
10-07-2014, 01:29 PM
I need some help with coding.
I need to to reset the status bar to default and turn screenupdating back on.
The following is what I have:
Application.StatusBar = "Retrieving data on NewState"
Application.ScreenUpdating = False
Range("E4:F21").Replace CurrentState, NewState
Application.ScreenUpdating = True
Application.StatusBar = "running macro"
Note: yes this is for an assignment, but I have exhausted all my avenues. Just need someone to hint at where I'm going wrong.
The macro runs fine, giving me no errors; however when I submit the assignment I receive the following errors back from sams.cengage.com about the macro:
Error in subprocedure "Update_Hours": Should change the text of the status bar to "Updating hours for " NewState.
Error in subprocedure "Update_Hours": Should reset the text of the status bar to its default value (set to "False").
Thank you for any help you can give!!
May Lindler

maylindler
10-07-2014, 04:01 PM
Final product:

Sub Update_Hours()
Dim CurrentState As String
CurrentState = Range("E4").Value
Dim NewState As String
NewState = Range("C4").Value
Application.StatusBar = "Updating hours for " & NewState
Application.ScreenUpdating = False
Range("E4:F21").Replace CurrentState, NewState
Application.ScreenUpdating = True
Application.StatusBar = False
End Sub



I need some help with coding.
I need to to reset the status bar to default and turn screenupdating back on.
The following is what I have:
Application.StatusBar = "Retrieving data on NewState"
Application.ScreenUpdating = False
Range("E4:F21").Replace CurrentState, NewState
Application.ScreenUpdating = True
Application.StatusBar = "running macro"
Note: yes this is for an assignment, but I have exhausted all my avenues. Just need someone to hint at where I'm going wrong.
The macro runs fine, giving me no errors; however when I submit the assignment I receive the following errors back from sams.cengage.com about the macro:
Error in subprocedure "Update_Hours": Should change the text of the status bar to "Updating hours for " NewState.
Error in subprocedure "Update_Hours": Should reset the text of the status bar to its default value (set to "False").
Thank you for any help you can give!!
May Lindler

SamT
10-07-2014, 05:18 PM
It looks you have solved your problem. Please use the Thread Tools at the top of the thread to mark this thread solved.

Thank you.