это мой код:
Sub index_test()
Dim i As Double
Dim Newsht As Worksheet
Dim countnonblank1, countnonblank2 As Integer
Dim myRange, nuRange As Range
Dim nuClass As Variant
Dim inpt, Msg, Title, MyInput As String
Set Newsht = ThisWorkbook.Sheets.Add(After:= _
ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
Newsht.Name = "new_temp"
Sheets("INDEX").Columns("a:b").Copy Sheets("new_temp").Columns("b:c")
Sheets("data test").Columns("e").Copy Sheets("new_temp").Columns("a")
Columns("A:A").Select
ActiveSheet.Range("$A$1:$A$500").RemoveDuplicates Columns:=1, Header:=xlNo
Set myRange = Columns("A:A")
countnonblank1 = Application.WorksheetFunction.CountA(myRange)
Set nuRange = Columns("B:B")
countnonblank2 = Application.WorksheetFunction.CountA(myRange)
For i = 2 To countnonblank1 + 1
**If Application.WorksheetFunction.VLookup**(Cells(i, 1), Range(Cells(2, 2), Cells(countnonblank2 + 1, 2)), 1, 0) = "#N/A" Then
inpt = Cells(i, 1)
Msg = "choose a new Index from the list for" & inpt & "? " _
& vbNewLine & "äëðñåú" & vbNewLine _
& "äðäìä" & vbNewLine _
& "îç÷ø" & vbNewLine _
& "ôéúåç" & vbNewLine _
& "ùéåå÷" & vbNewLine _
& "ñééáø"
Title = "Selection of Index" ' Define title.
MyInput = InputBox(Msg, Title)
Select Case MyInput
Case "äëðñåú", "äðäìä", "îç÷ø", "ôéúåç", "ùéåå÷", "ñééáø"
Cells(i, 3) = MyInput
Case Else
MsgBox "not ok"
End Select
Else
End If
Next
End Sub
в приложении vlookup я получаю ошибку времени выполнения 1004, у кого-нибудь есть идеи, почему и как это исправить?
спасибо заранее