S
Striker
I am trying to create a progress bar, but it needs to be after LastRow is
defined, so not sure where I should put my bar to go along with this For
Each Loop? So Basically each time I loop thru the FOR EACH, I would like to
update the progress bar. I must be putting it in the wrong place as it goes
thru the lop twice.
Any help is greatly appriciated
~~~~~~~~ProgressBar1~~~~~~~~~~~~~~~~~~
ProgressBar1.Min = 0
ProgressBar1.Max = LastRow
For i = 0 To LastRow
DoEvents
ProgressBar1.Value = i
Next i
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~CURRENT CODE~~~~~~~~~~~~~~~~~~~~~~~~~~
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set rng = Range("A2:A" & LastRow)
For Each rCell In rng.Cells
With rCell
.Offset(0, 5).Value = Trim(.Value) _
& Trim(.Offset(0, 3).Value) & Trim(lSerdate) & Trim(lCounter)
sLosdf = .Offset(0, 0)
sLdan = .Offset(0, 1)
sReason = .Offset(0, 2)
sUID = .Offset(0, 5)
sTel =(.Offset(0, 3).Value)
lCounter = lCounter + 1
End With
Next rCell
lCounter = lCounter - 1
defined, so not sure where I should put my bar to go along with this For
Each Loop? So Basically each time I loop thru the FOR EACH, I would like to
update the progress bar. I must be putting it in the wrong place as it goes
thru the lop twice.
Any help is greatly appriciated
~~~~~~~~ProgressBar1~~~~~~~~~~~~~~~~~~
ProgressBar1.Min = 0
ProgressBar1.Max = LastRow
For i = 0 To LastRow
DoEvents
ProgressBar1.Value = i
Next i
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~CURRENT CODE~~~~~~~~~~~~~~~~~~~~~~~~~~
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set rng = Range("A2:A" & LastRow)
For Each rCell In rng.Cells
With rCell
.Offset(0, 5).Value = Trim(.Value) _
& Trim(.Offset(0, 3).Value) & Trim(lSerdate) & Trim(lCounter)
sLosdf = .Offset(0, 0)
sLdan = .Offset(0, 1)
sReason = .Offset(0, 2)
sUID = .Offset(0, 5)
sTel =(.Offset(0, 3).Value)
lCounter = lCounter + 1
End With
Next rCell
lCounter = lCounter - 1