2D配列内の値が別の2D配列内に存在するかどうかを判断するのに役立つ関数が必要です。私はこのquestionで働いていた以前の機能をリファクタリングしようとしました。私はそのようなByref argument type mismatch
(以後、私はByValステートメントを追加しました)と、私が直面している現在のエラーfunction call on left-hand side of assignment
に遭遇しました。テストなし2D配列内の値が別の2D配列内にある場合関数
Public aLogic As Variant
Public Field_List(1 To 70, 1 To 10) As String, Field_No_of_Rows As Long
Sub Implement_Mapping()
Dim aMapRow As Integer, aMapCol As Integer
For aMapRow = LBound(aLogic, 1) To UBound(aLogic, 1)
For aMapCol = LBound(aLogic, 2) To UBound(aLogic, 2)
If IsInArrayByVal(aLogic(aMapRow, aMapCol), Field_List) = True Then
Debug.Print aLogic(aMapRow, aMapCol)
'For Each Break In ObjLSL
'Next
End If
Next aMapCol
Next aMapRow
End Sub
Function IsInArrayByVal(ByVal stringToBeFound As String, ByVal arr As Variant) As Boolean
IsInArray = Not IsError(Application.Match(stringToBeFound, Application.Index(arr, 0, 1), 0))
デバッグ/コンパイルを使用して、問題が発生したときに質問を更新します。例えば、 'Application.Match'は存在しません。 – Excelosaurus
ここでいくつかの質問をしようとしているようです。通常、投稿ごとに1つの問題に集中する必要があります。 –
@Excelosaurus、こちらをご覧ください:https://stackoverflow.com/questions/44159529/application-match-in-vbaしかし、Intellisenseでは表示されないことがあります。 –