LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Progress Bar

Is there any way to modify the following code so that the
progress bar will update itself according to how far along
the macro is?


Sub Main()
Dim i As Long, tot As Long
tot = 100
progressDlg.Caption = "Prosessing data, please wait..."
For i = 1 To tot
If i Mod 5 = 0 Then ProgressBar i / tot

Application.ScreenUpdating = False
Sheets("RMA Log 2").Select
Application.Calculation = xlCalculationManual
Workbooks.Open Filename:="W:\BaanReports\Sales\rma
report.xls"
Cells.Select
Selection.Copy
Windows("RMA Reasons Report.xls").Activate
Cells.Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Windows("rma report.xls").Activate
Application.CutCopyMode = False
ActiveWindow.Close
Rows("1:3").Select
Range("A3").Activate
Selection.Delete Shift:=xlUp
Columns("D:F").Select
Range("D:F,H:H,I:I,J:J,K:K").Select
Range("K1").Activate
Range("D:F,H:H,I:I,J:J,K:K,L:L,M:M").Select
Range("M1").Activate
Range("D:F,H:H,I:I,J:J,K:K,L:L,M:M,Q:R").Select
Range("Q1").Activate
Range("D:F,H:H,I:I,J:J,K:K,L:L,M:M,Q:R,S:S,T:U").S elect
Range("T1").Activate
Range
("D:F,H:H,I:I,J:J,K:K,L:L,M:M,Q:R,S:S,T:U,X:X").Se lect
Range("X1").Activate
Selection.Delete Shift:=xlToLeft
Columns("D:D").ColumnWidth = 11.43
Columns("E:E").ColumnWidth = 5
Columns("F:F").ColumnWidth = 20.14
Columns("G:G").ColumnWidth = 27.43
Columns("J:K").Select
Range("K1").Activate
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="CANCELLED"
Rows("2:10000").Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter Field:=1
Selection.AutoFilter Field:=2, Criteria1:="CANCELLED"
Selection.Delete Shift:=xlUp
Selection.AutoFilter Field:=2
Columns("J:K").Select
Range("K1").Activate
Selection.AutoFilter
Columns("J:K").Select
Range("K1").Activate
Selection.Delete Shift:=xlToLeft
Columns("G:G").Select
Selection.AutoFilter
ActiveWindow.ScrollColumn = 1
Range("A2:H20000").Select
Selection.Sort Key1:=Range("B2"),
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
Columns("B:B").Select
Selection.NumberFormat = "m/d"
Next i
Unload progressDlg
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress bar [email protected] Excel Discussion (Misc queries) 1 January 6th 07 01:49 PM
Progress Bar Donny Excel Programming 0 June 12th 04 05:56 PM
Progress Bar Rockee052[_2_] Excel Programming 3 December 28th 03 11:30 PM
Progress Bar Help Malcolm Excel Programming 2 November 25th 03 01:57 PM
Progress Bar Help Malcolm Excel Programming 2 November 21st 03 02:29 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"