One of my processes is quite time consuming so I'm trying to add a progress bar so the user knows the macro is still running. The problem is when the code gets to the point where the progress bar user form is shown ("UserForm1.Show"), everything stops.
This is my first attempt at a progress bar, so I'm sure I'm missing something simple. Below is an excerpt from the code where the progress bar should kick in.
Any suggestions would be greatly appreciated.
Using Excel 2010 and Windows 7
This is my first attempt at a progress bar, so I'm sure I'm missing something simple. Below is an excerpt from the code where the progress bar should kick in.
Any suggestions would be greatly appreciated.
HTML:
CurrentRow = 2
UserForm1.LabelProgress.Width = 0
UserForm1.Show
While CurrentRow <= LastRow
Combo = Left(Cells(CurrentRow, ShipToOrgNameColumn), 3) & "-" _
& Cells(CurrentRow, ItemNumberColumn).Value & "-" & Len(Cells(CurrentRow, ItemNumberColumn))
On Error Resume Next
MatchedRowNumber = WorksheetFunction.Match(Combo, DCPSheet.Range("A:A"), 0)
If MatchedRowNumber = 0 Then
POData.Range("C" & CurrentRow) = ""
Else
POData.Range("C" & CurrentRow).Value = DCPSheet.Range("N" & MatchedRowNumber).Value
End If
CurrentRow = CurrentRow + 1
MatchedRowNumber = 0
PctDone = CurrentRow / LastRow
With UserForm1
.FrameProgress.Caption = Format(PctDone, "0%")
.LabelProgress.Width = PctDone * (.FrameProgress.Width - 10)
End With
Wend
Using Excel 2010 and Windows 7