原文:http://spreadsheetpage.com/index.php/tip/a_custom_function_for_relative_sheet_references/
批注:经过多个实现版本的比较,认为这个版本兼容性比较好。
我们经常需要引用别的sheet的内容。但是EXCEL只提供基于sheet页名字的访问,并没有提供第几页查询的功能。
Function SHEETOFFSET(offset, Ref)
' Returns cell contents at Ref, in sheet offset
Application.Volatile
With Application.Caller.Parent
SHEETOFFSET = .Parent.Sheets(.Index + offset) _
.Range(Ref.Address).Value
End With
End Function
' Returns cell contents at Ref, in sheet offset
Application.Volatile
With Application.Caller.Parent
sheetat = .Parent.Sheets(offset) _
.Range(Ref.Address).Value
End With
End Function
注意:当引用到图表的时候,会发生错误。最后,感谢那些为办公软件做出贡献的人。
5635



被折叠的 条评论
为什么被折叠?



