alexandro88
11-05-2011, 10:19 AM
lr_Total = FormatPercent((lr1 / (lr1 + lr2)), 4)
Worksheets("LW").Activate
For Each rngcell In Range("A3:G3" & Range("A" & Rows.Count).End(xlUp).Row)
Ch1 = DateDiff("d", Range("A" & rngcell.Row).Value, LValue)
Ch2 = DateDiff("d", LValue, Range("B" & rngcell.Row).Value)
If Ch1 >= 0 And Ch2 >= 0 Then
Worksheet(""cal").Range("R1") = lr_Total
End If
Next
My program get error. How to run 2 worksheet at the same time in the loop?
Or got better suggestion?
Worksheets("LW").Activate
For Each rngcell In Range("A3:G3" & Range("A" & Rows.Count).End(xlUp).Row)
Ch1 = DateDiff("d", Range("A" & rngcell.Row).Value, LValue)
Ch2 = DateDiff("d", LValue, Range("B" & rngcell.Row).Value)
If Ch1 >= 0 And Ch2 >= 0 Then
Worksheet(""cal").Range("R1") = lr_Total
End If
Next
My program get error. How to run 2 worksheet at the same time in the loop?
Or got better suggestion?