预先感谢您的帮助。
我不确定UDF中的问题在哪里,但是excel在执行程序后会自动重新启动,并且还会使用参考值两次显示MsxBox。
Public queryString As String
Public Function SetIt(RefCell) As String
On Error GoTo CatchBlock
MsgBox RefCell.Value
queryString = RefCell.Value
RefCell.Parent.Evaluate "SetValue(" & RefCell.Address(False, False) & ")"
GoTo Finally
CatchBlock:
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, "Error in Function"
Finally:
SetIt = ""
End Function
// For now I am trying to set the cell reference value in some other cell.
Sub SetValue(RefCell As Range)
RefCell.Offset(1, 1).Value = queryString
End Sub
我仍然是初学者,需要根据此程序代码执行来完成另一项大任务。
请帮忙!
Excel 64位和Office 365是我的环境