簡體   English   中英

在Excel中使用數組項進行字符串比較,使用VBA進行字符串比較

[英]String Comparison with Array Item and String with VBA in Excel

這可能很簡單,但是我似乎無法找出問題所在:

if temp_array(1) = temp_string2 & temp_array(2) = "w" then
....
end if

值是:

temp_array(1)=“ test1”

temp_string2 =“ test2”

temp_array(2)=“ w”

我收到類型不匹配錯誤,突出顯示了條件比較...

&是字符串連接,不是邏輯and

if temp_array(1) = temp_string2 And temp_array(2) = "w" then 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM