Excel Function 一般不能更改单元格的值. (Change a cell value) Only the calling cell or array and only by return value. 但还是可以实现更改单元格的值的. Option Explicit '************************************************************************* '**╭⌒╮⌒╮ ︸ ︷ ﹀ ︿ '**╱◥██◣ Home ﹀ ︷ ︸ '**|田|田 田|﹏﹏﹏﹏﹏﹏﹏﹏﹏﹏﹏﹏ '**╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬ '**Mail:Stanley.pan2000@Hotmail.com '************************************************************************* Function ChangeCellValue(ByVal SelectCells As Range) 'Only the calling cell or array and only by return value 'Call changeCell 'SelectCells.Value = "testing" 'Application.Volatile On Error Resume Next ChangeCellValue = SelectCells.Interior.ColorIndex SelectCells.Value2 = "Only for testing" End Function Sub changeCell() Range("A1") = "testing" End Sub
9FeTfvvx.zip
(6.69 KB, 下载次数: 26)
[此贴子已经被作者于2008-1-9 21:41:25编辑过] |