Sub AA()
Sheet1.Select
Range("A1").Select
For X = 2 To 4
If 1 = 1 Then
M = Sheet1.Cells(X, 1)
mymax = Evaluate("VLOOKUP(M,工作表2!A:B,2,FALSE)")
Sheet1.Cells(X, 2) = mymax
End If
Next
DEAR ALL大大
圖二為程式碼
圖一之 Z 要如何改方可執行.煩不吝賜教. THANKS*10000
圖一
mymax = Evaluate("VLOOKUP(""" & M & """,'結果2'!A:Y,Z,FALSE)")
圖二
Sub 一()
Sheet6.Select
Range("A1").Select
Sheet6.[D4:AA7].ClearContents
For X = 4 To 7
For Y = 4 To 7
For Z = 2 To 5
If 1 = 1 Then
M = Sheet6.Cells(X, 3)
mymax = Evaluate("VLOOKUP(""" & M & """,'結果2'!A:Y,Z,FALSE)")
If Application.IsError(mymax) = True Then mymax = "" '取代VLLOUP判斷2
Sheet6.Cells(X, Y) = mymax
End If
Next
Next
Next
End Sub作者: GBKEE 時間: 2015-3-25 16:35
Sub 一級()
Sheet6.Visible = True
Sheet1.Visible = False
Sheet6.Select
Range("A1").Select
Sheet6.[D4:AC7].ClearContents
For X = 4 To 7
If 1 = 1 Then
M = Sheet6.Cells(X, 3)
mymax = Evaluate("VLOOKUP(""" & M & """,'結果2'!A:AA,2,FALSE)")
If Application.IsError(mymax) = True Then mymax = "" '取代VLLOUP判斷2
Sheet6.Cells(X, 4) = mymax
mymax1 = Evaluate("VLOOKUP(""" & M & """,'結果2'!A:AA,3,FALSE)")
If Application.IsError(mymax) = True Then mymax = "" '取代VLLOUP判斷2
Sheet6.Cells(X, 5) = mymax1
mymax2 = Evaluate("VLOOKUP(""" & M & """,'結果2'!A:AA,4,FALSE)")
If Application.IsError(mymax) = True Then mymax = "" '取代VLLOUP判斷2
Sheet6.Cells(X, 6) = mymax2
mymax3 = Evaluate("VLOOKUP(""" & M & """,'結果2'!A:AA,5,FALSE)")
If Application.IsError(mymax) = True Then mymax = "" '取代VLLOUP判斷2
Sheet6.Cells(X, 7) = mymax3