在工资表中希望查询的用户能看到工资的计算方法,这样大家看到后就知道每一项是如何计算的。可以通过快表VBA实现,单击单元格时将单元格中的公式写入一个集中显示的区域。
- Public Sub RangeSelection(sender As Object,e As SpreadsheetGear.Windows.Controls.RangeSelectionChangedEventArgs)
- ActiveWorkbook.WorkbookSet.GetLock()
- On Error Resume Next
- Dim Rng As IRange = e.RangeSelection.Intersect(Range("T_1"))
- If Rng IsNot Nothing Then
- 'ActiveWorkbook.ActiveWorksheet.Range.Cells(0,e.RangeSelection.Column).value = e.RangeSelection.Formula
- ActiveWorkbook.ActiveWorksheet.Range("FormulaArea").Value = "'" + e.RangeSelection.Formula
- End If
- ActiveWorkbook.WorkbookSet.ReleaseLock()
- End Sub'单元格选择后执行的事件
复制代码
|
|
hessen