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.
对于在 Excel 中调用的函数,可以使用 ,获取调用工作簿名称Application.Caller.Worksheet.Parent.Name和单元格地址。Application.Caller.Address
Application.Caller.Worksheet.Parent.Name
Application.Caller.Address
有没有办法使用 获取工作表名称,例如 Sheet1 Application.Caller?
Application.Caller
你几乎已经有了
Application.Caller.Worksheet.Name
Dim called_by As Variant Dim x as string Set called_by = Application.Caller x = called_by.Parent.Application.Activesheet.Name
在单元格中调用此函数时,在我的应用程序中工作正常。