呵呵,我也来问一句。以下是一个自定义函数。我想版主帮我解释一下红色字那句的Address(, , xlR1C1)的用法。 谢谢。 Private Function getvalue(path As String, file As String, sheet As String, ref As String) Dim arg As String '定义存储变量 If Right(path, 1) "\" Then path = path & "\" '确保文件存在 If Dir(path & file) = "" Then getvalue = MsgBox("file no found") Exit Function End If '为变量赋值 arg = "'" & path & "[" & file & "]" & sheet & "'!" & _ Range(ref).Range("a1").Address(, , xlR1C1) '调用XLM老式宏 getvalue = ExecuteExcel4Macro(arg) End Function
红色部分返回指定工作表的引用范围的第一个单元格的绝对地址(以R1C1形式)
[此贴子已经被清风_ll于2006-6-8 21:42:52编辑过] |