level 11
情义灬情
楼主
Dim i, j, m, n, nlr4, nlr2, ds As Integer
nlr2 = xlsheet2.Cells.SpecialCells(11).Row
nlr4 = xlsheet4.Cells.SpecialCells(11).Row
Dim strcode, strcust, strdate, x, y, z As String
' Dim dt As Date
For i = 1 To nlr2
For m = 1 To nlr4
strcode = "XCODE" + xlsheet2.Cells(i, 1).value.ToString
strcust = "YCUST" + xlsheet2.Cells(i, 4).value.ToString
strdate = "ZZZZZ" + xlsheet2.Cells(i, 2).value.ToString
If strcode = xlsheet4.Cells(m, 1).value.ToString Then
x = xlsheet4.Cells(m, 2).value
For j = m To nlr4
If strcust = xlsheet4.Cells(j, 1).value Then
y = xlsheet4.Cells(j, 2).value
For n = j To nlr4
If strdate = xlsheet4.Cells(n, 1).value Then
ds = n + x + y
z = xlsheet4.Cells(ds, 1).value.ToString.Replace("ZZZZZ", "")
' dt = z
xlsheet2.Cells(i, 5).value = z '.ToString("yyyyMMdd")
Else
End If
Next n
End If
Next j
End If
Next m
Next i
2013年12月05日 01点12分
1
nlr2 = xlsheet2.Cells.SpecialCells(11).Row
nlr4 = xlsheet4.Cells.SpecialCells(11).Row
Dim strcode, strcust, strdate, x, y, z As String
' Dim dt As Date
For i = 1 To nlr2
For m = 1 To nlr4
strcode = "XCODE" + xlsheet2.Cells(i, 1).value.ToString
strcust = "YCUST" + xlsheet2.Cells(i, 4).value.ToString
strdate = "ZZZZZ" + xlsheet2.Cells(i, 2).value.ToString
If strcode = xlsheet4.Cells(m, 1).value.ToString Then
x = xlsheet4.Cells(m, 2).value
For j = m To nlr4
If strcust = xlsheet4.Cells(j, 1).value Then
y = xlsheet4.Cells(j, 2).value
For n = j To nlr4
If strdate = xlsheet4.Cells(n, 1).value Then
ds = n + x + y
z = xlsheet4.Cells(ds, 1).value.ToString.Replace("ZZZZZ", "")
' dt = z
xlsheet2.Cells(i, 5).value = z '.ToString("yyyyMMdd")
Else
End If
Next n
End If
Next j
End If
Next m
Next i