所以一切正常,但vlookup部分。 vlookup的查找值不随单元格行移动。我不知道如何让“F& cell.number”与行一起移动。
Sub fontredd()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim rngL As range
Dim cell As range
Set rngL = range("L1", range("L65536").End(xlUp))
For Each cell In rngL
If cell.Value = "0" Then
cell.EntireRow.Font.Color = vbRed
cell.Formula = "=VLOOKUP(F&cell.number,[PickupCompaniesCommissions.xls]Sheet1!$U:$V,2,FALSE)"
End If
Next cell
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
答案 0 :(得分:1)
cell.Formula = "=VLOOKUP(F" & cell.Row & ", [PickupCompaniesCommissions.xls]Sheet1!$U:$V,2,FALSE)"