• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Progress bar for macro complition time

Pinang

Member
Hi

I have created a rather large macro that does multiple tasks when run.

I would like to create a message box that pops progress bar for macro and hides all the background workings that the macro performs.

Thanks in advance.
 
First, if you haven't already, you should be using:
Code:
Application.ScreenUpdating = False
'do stuff
Application.ScreenUpdating = True
with your coding so that user doesn't see what is going on, and macro can run faster due to not having to update the screen.

Next, consider that if you add code to create a progress bar, overall process will take longer, as it now has extra steps to do. But, if you want to do it, here's my recommendation:
http://spreadsheetpage.com/index.php/site/tip/displaying_a_progress_indicator/
 
Hi,

Hear is my code, I am creating seperate files for each sheets and want to show progress bar or progress status % on status bar.
Code:
Sub Generate_Files()
Dim rCell As Range
Dim Data As Range
Dim a As Range
Dim mySheet As String
Dim filename1 As String
Application.DisplayAlerts = False
Application.ScreenUpdating = False

Set a = Range("O4")
For Each rCell In Range("File_Name_List")
a.Value = rCell.Value

Sheets("Macro").Activate
mySheet = Worksheets("Macro").Range("O4").Value
filename1 = Worksheets("Macro").Range("O1").Value
Worksheets(mySheet).Select
  Range("A1").Select
  ActiveSheet.Copy
  Range("C5").Select
  Selection.Copy
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
  :=False, Transpose:=False
  Application.CutCopyMode = False
  Range("A1").Activate
  ChDir "D:\Revenue_Booking_Accrual"
  ActiveWorkbook.SaveAs filename:=filename1, _
  FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
  Range("A1").Select
  ActiveWindow.Close
  Sheets("Macro").Activate
  Range("O4").Select

Next rCell
Set rCell = Nothing
Set Data = Nothing
Set a = Nothing
Sheets("Macro").Select
Range("A1").Select
Sheets("Summary").Select
Range("A1").Select
ActiveWorkbook.Save
MsgBox "Done"
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
 
Last edited by a moderator:
Back
Top