L
Legacy 395409
Guest
For the life of me I cannot figure out what am I missing....
'-----------------------------------------------------------
Sub Inert_Copied_Rows()
OpenStatusBar
Worksheets("1149000-00-A").Activate
Dim Total As Integer
Dim Row As Integer
Dim r As Long
For r = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
With Cells(r, 3)
If IsNumeric(.Value) And Not IsEmpty(.Value) Then
Rows(r + 1).Resize(.Value).Insert
Range(Replace("A#:AK#", "#", r)).Copy Destination:=Range("A" & r + 1).Resize(.Value)
End If
DoEvents
Call RunStatusBar(Row, Total)
End With
Next r
Unload StatusBar
MsgBox "All Needed Rows Added!"
End Sub
'-----------------------------------------------------------
Sub OpenStatusBar()
With StatusBar
.Bar.Width = 0
.Frame.Caption = "0% Complete"
.Show vbModeless
End With
End Sub
'-----------------------------------------------------------
Sub RunStatusBar(Row As Integer, Total As Integer)
With StatusBar
.Bar.Width = 288 * (Row / Rows.Count)
.Frame.Caption = Round((Row / Rows.Count) * 100, 0) & "% Complete"
End With
End Sub
'-----------------------------------------------------------