简体   繁体   English

VBA Excel中的VLOOKUP函数问题

[英]VLOOKUP function issue in VBA excel

I did a lot of research on this topic, but could not find a solution. 我对此主题进行了大量研究,但找不到解决方案。 I created a macro to search for value and put it in the cell. 我创建了一个宏来搜索值并将其放在单元格中。 My program returns me error ie 1004 which means data not found. 我的程序向我返回错误,即1004,表示未找到数据。 I debugged the program and found that the value, when it was fetched it was "TSK0000000788", but when I incorporated that variable in the VLOOKUP function it changed it to "TSK788". 我调试了程序,发现该值在被获取时为“ TSK0000000788”,但是当我将该变量合并到VLOOKUP函数中时,它将其更改为“ TSK788”。 I also tried to change the format of cell, just to see if it helps, when I changed it to Text, Formula was not working. 我还尝试了更改单元格的格式,只是为了查看它是否有帮助,当我将其更改为“文本”时,“公式”无法正常工作。 By default it was set to General only. 默认情况下,它设置为“仅常规”。 Is this error common? 这个错误常见吗?

I have tested VLOOKUP function with various formats in the Table, so Long as your Lookup value is ("TSK788") in the function, it works correctly. 我已经在表中以各种格式测试了VLOOKUP函数,因此只要您在函数中的Lookup值为(“ TSK788”),它就可以正常工作。 Please try your function on a new workbook on a new sheet after pasting data on some Text Editor like Note Tab Light or Note pad and the again copying and pasting data to your new worksheet. 将数据粘贴到某些文本编辑器(如“笔记标签灯”或“记事本”)上,然后将数据再次复制并粘贴到新工作表之后,请在新工作表的新工作簿上尝试使用该功能。 Please see if the problem still persists. 请查看问题是否仍然存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM