使用.Find查看另一个工作表

时间:2021-09-03 22:58:26

I have aset of account names in one workbook (the active one), and I need to use the .Find function to look for their ocurrences in another workbook/sheet. I don't think I'm getting the right Object handle for the other workbook/sheet, but nothing I try is working.

我在一个工作簿(活动的)中有一组帐户名,我需要使用.Find函数在另一个工作簿/工作表中查找它们的出现次数。我不认为我正在为其他工作簿/工作表获得正确的Object句柄,但我尝试的任何工作都没有。

For Count = 1 to 10

accName = Cells(Count, 1).Value

AccRow(Count) = OBJECTHANDLE.Find(accName).Row

Next Count

Any help?

1 个解决方案

#1


Never mind, I found the answer with perserverence (it's so rare at the end of the day). Needs to have the Object defined up to .Range, so:

没关系,我找到了坚持不懈的答案(在一天结束时这种情况非常罕见)。需要将Object定义为.Range,因此:

Workbooks("WORKBOOK").Sheets("SHEET").Range("RANGE")

I hate VBA.

我讨厌VBA。

#1


Never mind, I found the answer with perserverence (it's so rare at the end of the day). Needs to have the Object defined up to .Range, so:

没关系,我找到了坚持不懈的答案(在一天结束时这种情况非常罕见)。需要将Object定义为.Range,因此:

Workbooks("WORKBOOK").Sheets("SHEET").Range("RANGE")

I hate VBA.

我讨厌VBA。