私は、これらの5つのセルを一緒に比較したいと言います( "行"は整数です)。それらのすべてがこれらの正確な単語 "Not Applicable"を持っている場合は、出力のセルも "Not Applicable"になります。私は.Textを.Valueに置き換えようとしましたが、どちらも動作しません。これは、私を許してください、いくつかの愚かな間違いがある場合はファイル名を指定して実行時エラー「13」vbaを使って複数のセルのテキストを比較する
Private Sub CommandButton1_Click()
Dim DocNo As Integer
Dim line As Integer
DocNo = (InputBox("Please input document number of record you would like to view"))
line = 1
'Checks the first cell of the results sheet until the number in first cell = the DocNo
'if "DocNo" = the number in the cell, Line is set to its respective y coordinate
Do
line = line + 1
Loop While (DocNo <> Worksheets("Results").Cells(line, 1))
If (Worksheets("Results").Cells(line, 5).Text) And
(Worksheets("Results").Cells(line, 57).Text) And
(Worksheets("Results").Cells(line, 59).Text) And
(Worksheets("Results").Cells(line, 32).Text) And
(Worksheets("Results").Cells(line, 40).Text) = "Not Applicable" Then
Worksheets("Output").Cells(26, 3) = "Not Applicable"
End If
End Sub
が常にあります、私はほんの数日
説明されているエラーは、アルゴリズムそのものではなく、(少数の)タイプミスによるものです。 @ Ledavidiado:これにもっと苦労したら、新しい質問をするか、この問題を正確にどこに反映させるかを自由に編集してください。 –