Process Bar

jgresko

New Member
Joined
Jun 2, 2011
Messages
9
I have an Excel spreadsheet that I inherited and I have fixed and added everything for my department. The spreadsheet has an update tab that runs numerous VBA subs to update the sheet after runing a query. The update is long, so there is a progress and process bar to show the user how much longer they will need to wait. The progress bar works fine, but the process bar does not move like it should. Attached are the portions of the VB code that pertains to the process bar. Please Help.

Code:
Dim progress As Integer
Dim process As Integer
Dim total As Integer

Code:
Sub updateAllData()
Application.DisplayAlerts = False
progress = 0
process = 0
Sheets("Update").ProgressBar1.Value = progress
Sheets("Update").ProgressBar2.Value = process
Sheets("Update").btnUpdateAll.Caption = "Updating"
Application.ScreenUpdating = False
updateBar1
makeMissing
updateBar1
Delete_rows_DC
Change_DC_ReturnTypeToP
Change_DC_ReturnTypeM
Change_DC_ReturnTypeU
Change_DC_ReturnTypeBlank
Delete_rows_FL
Change_FL_ReturnTypeToP
Change_FL_ReturnTypeM
Change_FL_ReturnTypeU
Change_FL_ReturnTypeBlank
Delete_rows_LE
Change_LE_ReturnTypeToP
Change_LE_ReturnTypeM
Change_LE_ReturnTypeU
Change_LE_ReturnTypeBlank
Delete_rows_PE
Change_PE_ReturnTypeToP
Change_PE_ReturnTypeM
Change_PE_ReturnTypeU
Change_PE_ReturnTypeBlank
Delete_rows_SE
Change_SE_ReturnTypeToP
Change_SE_ReturnTypeM
Change_SE_ReturnTypeU
Change_SE_ReturnTypeBlank
Delete_rows_SL
Change_SL_ReturnTypeToP
Change_SL_ReturnTypeM
Change_SL_ReturnTypeU
Change_SL_ReturnTypeBlank
Delete_rows_787
Change_787_ReturnType8
Change_787_ReturnType700
Change_787_ReturnType7011
'makeListed'
Application.ScreenUpdating = False
updateBar1
Application.ScreenUpdating = False
Workbooks.Open Filename:="R:\Delete_Yearly\Production Returns\Production_Return_Status(Updates_Go_Here).xls"
Windows("Production_Return_Status(Updates_Go_Here).xls").Activate
Application.ScreenUpdating = False
Application.DisplayAlerts = False
If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
If ActiveWorkbook.MultiUserEditing Then ActiveWorkbook.ExclusiveAccess
addStatus
updateBar1
Windows("Production_Return_Status(Updates_Go_Here).xls").Activate
cleanStatus
updateBar1
Application.ScreenUpdating = False
Windows("Production_Return_Status(Updates_Go_Here).xls").Activate
        ActiveWorkbook.SaveAs Filename:= _
        "R:\Delete_Yearly\Production Returns\Production_Return_Status(Updates_Go_Here).xls", AccessMode:= _
        xlShared
ActiveWorkbook.Close (False)
Workbooks("Production_Returns_Main.xls").Activate
makeChartData
updateBar1
updateBar2
Sheets("Update").btnUpdateAll.Caption = "Run Update"
Sheets("Update").ProgressBar1.Value = 10
Application.ScreenUpdating = True
End Sub

Code:
Sub updateBar1()
Windows("Production_Returns_Main.xls").Activate
Sheets("Update").Select
Application.ScreenUpdating = True
Sheets("Update").ProgressBar1.Value = progress
progress = progress + 2
Application.ScreenUpdating = False
End Sub

Code:
Sub updateBar2()
Windows("Production_Returns_Main.xls").Activate
Sheets("Update").Select
Application.ScreenUpdating = True
Sheets("Update").ProgressBar2.Value = progress
process = process + 2
Application.ScreenUpdating = False
End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
is this
Code:
Sub updateBar2()
Windows("Production_Returns_Main.xls").Activate
Sheets("Update").Select
Application.ScreenUpdating = True
Sheets("Update").ProgressBar2.Value = progress
process = process + 2
Application.ScreenUpdating = False
End Sub
suppose to be
Code:
Sub updateBar2()
Windows("Production_Returns_Main.xls").Activate
Sheets("Update").Select
Application.ScreenUpdating = True
Sheets("Update").ProgressBar2.Value = [COLOR=blue]process ' progress[/COLOR]
process = process + 2
Application.ScreenUpdating = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top