无法获取WorksheetFunction类的Vlookup属性 [英] Unable to get the Vlookup property of the WorksheetFunction class

查看:732
本文介绍了无法获取WorksheetFunction类的Vlookup属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从名为CashReward的电子表格中找到员工姓名及其导入日期。

I am trying to find an Employee name and their Import date from a spreadsheet called CashReward.

下面的代码出现错误信息无法获得WorksheetFunction类的Vlookup属性'。我尝试将数据类型更改为 CDate CStr ,但无法使用。

The coding below is appearing with an error message 'Unable to get the Vlookup property of the WorksheetFunction class'. I have tried changing the data type to CDate and CStr but no use.

concat = EmpName& GetDate

BasicSal = WorksheetFunction.VLookup(CVar(concat), Sheets("CashReward").Range("G3:K" & Cashlastrow), 2, False)

提前感谢


Thanks in advance

推荐答案

如果在给定范围内找不到搜索字符串,则会发生这种情况。

This happens if your search string is not found in the given range.

请注意,范围中的数据需要按升序排序,请参阅 http://office.microsoft.com/en-us/excel-help/vlookup-HP005209335.aspx

Note that the data in the range needs to be sorted in ascending order, see http://office.microsoft.com/en-us/excel-help/vlookup-HP005209335.aspx


table_array的第一列中的值必须放在
升序排列顺序中;否则,VLOOKUP可能不会给出正确的
值。您可以通过从数据菜单中选择Sort
命令并选择升序,将值放在升序中。有关更多
信息,请参阅默认排序顺序。

The values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP may not give the correct value. You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending. For more information, see Default sort orders.

这篇关于无法获取WorksheetFunction类的Vlookup属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆