Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我应该使用什么函数或公式来获取工作表的序数?
例如,如果我有两张名为“foo”和“bar”的工作表,get_sheet_num()当从“foo”调用时该函数应返回 1,从“bar”调用时应返回 2
get_sheet_num()
这将正确返回工作表索引:
Public Function get_sheet_num() As Long get_sheet_num = Application.Caller.Worksheet.Index End Function