0
我试图在offset()
和match()
函数中使用变量。但它不起作用。偏移+与变量vba匹配
For Each Valid_type In Valid_sec_type_range
'test = Valid_sec_type_range.Cells(1, Valid_type_index).Value
'test1 = Chr(34) & Valid_type & Chr(34)
new_range = [OFFSET(Market_value_range,MATCH(Valid_type,sec_type,0)-1,0,COUNTIF(sec_type,Valid_type),1)]
,当我使用这个它的工作原理,似乎功能匹配和失调不承认Valid_type
作为一个字符串。
For Each Valid_type In Valid_sec_type_range
'test = Valid_sec_type_range.Cells(1, Valid_type_index).Value
'test1 = Chr(34) & Valid_type & Chr(34)
new_range = [OFFSET(Market_value_range,MATCH("Asset Backed",sec_type,0)-1,0,COUNTIF(sec_type,"Asset Backed"),1)]
谢谢您的帮助! 但它说:运行时错误1004,无法获取工作表功能类的匹配属性。 – 2015-04-02 17:37:12
这意味着无法在'sec_type'范围内找到'Valid_type.Value'。 – GSerg 2015-04-02 18:44:55