advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 7930 for VLOOKUP (0.002 sec.)
[[20110812121548]]
#score: 3346
@digest: 49dda5b9f877b0917ebce03d1cb5482d
@id: 55542
@mdate: 2011-08-12T03:55:23Z
@size: 1760
@type: text/plain
#keywords: answer1 (104108), 換") (28554), 行変 (15889), myname (5966), るel (2373), いen (1845), ー" (1738), chk (1490), vlookup (1227), ト関 (1200), worksheetfunction (1144), で戻 (1135), iserror (1084), 変換 (1048), application (934), 継続 (787), か( (687), name (649), 、di (598), 事前 (588), test1 (547), msgbox (544), り値 (529), variant (500), クシ (475), エラ (460), ラー (429), test2 (426), 戻り (386), 処理 (353), ーク (328), 衝突 (299)
『ワークシート関数で戻り値がない場合の処理について』(oku)
ワークシート関数で戻り値がない場合にエラーとなり処理が止まりますが どのような処理を行えば処理を継続できるのでしょうか? vlookup関数で結果をanswer1に入れていますが、anser1=の行でエラーとなります answer1 = Application.WorksheetFunction.VLookup(name, Range("name行変換"), 2, False) MsgBox answer1 よろしくお願いいたします ---- 1、 Dim answer1 as long On error resume next answer1 = Application.WorksheetFunction.VLookup(name, Range("name行変換"), 2, False) on error goto 0 if answer1 > 0 Then ある else ない end if あああ、VLookupでしたよね。 じゃぁ、1の方はなし。(Matchと同じにしてしまった。)12:52 追加 2、 Dim answer1 as Variant answer1 = Application.VLookup(name, Range("name行変換"), 2, False) if not iserror(answer1) Then ある else ない end if BJ ---- 衝突しましたが、そのまま・・・ Application.WorksheetFunction.VLookup を Application.VLookup と書くとエラーを返すのでIsErrorでチェックするか(test1) 事前にCountIf関数で存在をチェックするか(test2) くらいが簡単ではないでしょうか Sub test1() Dim answer1 As Variant Dim myName As String myName = "test" answer1 = Application.VLookup(myName, Range("name行変換"), 2, False) If IsError(answer1) Then MsgBox "エラー" Else MsgBox answer1 End If End Sub Sub test2() Dim answer1 As Variant Dim myName As String Dim chk As Long myName = "test" chk = Application.WorksheetFunction.CountIf(Range("name行変換"), myName) If chk = 0 Then MsgBox "エラー" Else answer1 = Application.VLookup(myName, Range("name行変換"), 2, False) MsgBox answer1 End If End Sub (momo) ...
https://www.excel.studio-kazu.jp/wiki/kazuwiki/201108/20110812121548.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97038 documents and 608190 words.

訪問者:カウンタValid HTML 4.01 Transitional