我正在嘗試使用匹配來查找單元格的行。我已經能夠與使用匹配功能和顏色標準
rowfound = Application.WorksheetFunction.Match("123", Range("A:A"), 0)
但是來到這裏的在那裏我停留在做到這一點。 「123」可能已經出現在同一列多次(這些已被填充顏色),我試圖找到最新的「123」單元格。這個單元格不會被填充任何顏色。
我試過以這種方式輸入,但我相信Interior.ColorIndex = 0
只適用於對象而不適用於範圍。
rowfound = Application.WorksheetFunction.Match("123", Range("A:A").Interior.ColorIndex = 0, 0)
我也想這樣做的無色細胞Selection.Address
,做從那裏比賽,但這樣會導致匹配功能給人一種結果,是不是哪裏的細胞是在工作表中的行(它會給出它可以在選擇中找到的行)[即實際單元格行中的「123」= 2000,但給出的結果是「1」,這是選擇中的行]。我對這個代碼是
RRR = Selection.Address
rowfound = Application.WorksheetFunction.Match("123", Range(RRR), O)
不知道如何解決這個問題?希望我在解釋我的問題時很清楚。
不知道是什麼讓你覺得你可以使用匹配這樣的。儘管可以使用格式化查找方法。 – SJR
使用Range.Find與SearchFormat參數一起查找相關的單元格 – Tragamor