Excel 自定义函数,获取输入公式的位置
展开全部
按Alt+F11,打开VBA编辑器,单击菜单“插入→模块”,在代码窗口中输入下列代码:
Function GetSheetName(idx As Integer, Optional relative_position As Boolean) As String
Application.Volatile
GetSheetName = Sheets(IIf(relative_position, ActiveSheet.index - -idx, idx)).Name
End Function
Function GetSheetName(idx As Integer, Optional relative_position As Boolean) As String
Application.Volatile
GetSheetName = Sheets(IIf(relative_position, ActiveSheet.index - -idx, idx)).Name
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询