来自另一个工作簿的VLOOKUP,但错误是#value

时间:2017-07-15 20:18:40

标签: excel vba excel-vba vlookup inputbox

我从用户那里获取输入并使用此输入我使用来自另一个工作簿的vlookup。但是我无法获得正确的值,总是#value错误

<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

1 个答案:

答案 0 :(得分:1)

您可以尝试这样的事情......

Dim tbl As ListObject
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$H$1500"), , xlYes).Name = _
        "Table1"

Set tbl = ActiveSheet.ListObjects("Table1")
With twb.Sheets("Sheet1")
    .Cells(j, 4) = Application.VLookup(.Cells(j, 2).Value2, tbl.Range, 6, False)
End With