将VB循环转换为Javascript



我试图让这在Javascript工作。它在Visual Basic中工作得很好。我如何正确地调用循环工作的正确行和列?

Dim i As Integer, j As Integer, k As Integer
i = 2
j = 6
k = 1
Do While k < 200
If Cells(i, j) <= Sheets("Outlines").Cells(1, 8) Then
Cells(i, j - 3) = Cells(i, j)
Cells(i, j - 2) = Application.VLookup(Cells(i, j - 5), Sheets("View").Range("A2:P48"), 4, False)
Cells(i, j - 1) = Application.VLookup(Cells(i, j - 5), Sheets("View").Range("A2:P48"), 5, False)
End If
i = i + 1
k = k + 1
Loop

1到1的转换假设vbcall有小写JS的等效物

let i = 2, j = 6, k = 1;
while (k < 200) {
if (cells(i, j) <= sheets("Outlines").cells(1, 8)) {
cells(i, j - 3) = cells(i, j)
cells(i, j - 2) = application.VLookup(cells(i, j - 5), sheets("View").range("A2:P48"), 4, false)
cells(i, j - 1) = application.VLookup(Cells(i, j - 5), sheets("View").range("A2:P48"), 5, false)
}
i++;
k++;
}

最新更新