1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Option Explicit
Public Function FORMULAGET(ByVal rgeCell As Range, _ Optional ByVal bCellAddressPrefix As Boolean = False) As String Call Application.Volatile(True) If VarType(rgeCell) = 8 And Not rgeCell.HasFormula Then FORMULAGET = "'" & rgeCell.Formula Else FORMULAGET = rgeCell.Formula End If If rgeCell.HasArray Then FORMULAGET = "{" & rgeCell.Formula & "}" End If If bCellAddressPrefix = True Then FORMULAGET = rgeCell.Address(0, 0) & ": " & FORMULAGET End If End Function
|