Sub Get_hp(hp, x, y) Application.StatusBar = "基点を取得しています" Set tf = CreateObject("Scripting.FileSystemObject") pth = ThisWorkbook.Path Set tf_txt = tf.OpenTextFile(pth & "\jwc_temp.txt", 1, True) Do Until tf_txt.AtEndOfStream tmp = tf_txt.readline '1行読み込み If Left(tmp, 3) = "hp" & Right(Str(1), 1) Then kiten_tmp = Split(Right(tmp, Len(tmp) - 6)) x = Val(kiten_tmp(0)) y = Val(kiten_tmp(1)) Exit Do End If Loop End Sub
ex: Call Get_hp(2 ,x0 ,y0)