Function CI(c) 'Cells.Address.Information
If IsNumeric(c) Then
On Error GoTo NumErr
CI = Replace(Cells(, c).Address(0, 0), 1, "")
Else
On Error GoTo TxtErr
CI = Range(c & 1).Column
End If
Exit Function
NumErr:
CI = "Not 1-" & Cells(Cells.Count).Column & " !": Exit Function
TxtErr:
CI = Cells(Cells.Count).Address(1, 0)
CI = "Not A-" & Left(CI, InStr(CI, "$") - 1) & " !": Exit Function
End Function
转自ExcelHome 香川群子
http://club.excelhome.net/thread-945200-1-1.html
本文介绍了一段 VBA 代码,用于获取 Excel 中单元格的地址信息。该函数 FunctionCI 可根据传入的参数类型返回不同的单元格标识信息,包括对于数值型和文本型数据的不同处理方式。
1213

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



