P Pete Jun 1, 2011 #1 Is there a way to tell if a value in a cell has been treated with the =TEXT formula, and then pasted back as values? Pete
Is there a way to tell if a value in a cell has been treated with the =TEXT formula, and then pasted back as values? Pete
J joeu2004 Jun 1, 2011 #2 Is there a way to tell if a value in a cell has been treated with the =TEXT formula, and then pasted back as values? Click to expand... Certainly not literally. You cannot know what was in the cell before it was changed. However, you can write a macro that determines if a cell contains a formula or not. Function cellHasFormula(r As Range) As Boolean cellHasFormula = r.hasFormula End Function AFAIK, there is no way to accomplish the same thing using just Excel functions.
Is there a way to tell if a value in a cell has been treated with the =TEXT formula, and then pasted back as values? Click to expand... Certainly not literally. You cannot know what was in the cell before it was changed. However, you can write a macro that determines if a cell contains a formula or not. Function cellHasFormula(r As Range) As Boolean cellHasFormula = r.hasFormula End Function AFAIK, there is no way to accomplish the same thing using just Excel functions.
C Claus Busch Jun 1, 2011 #3 Hi Pete, Am Wed, 1 Jun 2011 08:25:16 -0700 (PDT) schrieb Pete: Is there a way to tell if a value in a cell has been treated with the =TEXT formula, and then pasted back as values? Click to expand... for TEXT formula in range("C1:C10"): Sub TextFormula() Dim rngCell As Range For Each rngCell In Range("C1:C10") With rngCell If Left(.Formula, 5) = "=TEXT" Then .Value = .Value End If End With Next End Sub Regards Claus Busch
Hi Pete, Am Wed, 1 Jun 2011 08:25:16 -0700 (PDT) schrieb Pete: Is there a way to tell if a value in a cell has been treated with the =TEXT formula, and then pasted back as values? Click to expand... for TEXT formula in range("C1:C10"): Sub TextFormula() Dim rngCell As Range For Each rngCell In Range("C1:C10") With rngCell If Left(.Formula, 5) = "=TEXT" Then .Value = .Value End If End With Next End Sub Regards Claus Busch
P Pete Jun 1, 2011 #4 Hi Pete, Am Wed, 1 Jun 2011 08:25:16 -0700 (PDT) schrieb Pete: for TEXT formula in range("C1:C10"): Sub TextFormula() Dim rngCell As Range For Each rngCell In Range("C1:C10") With rngCell If Left(.Formula, 5) = "=TEXT" Then .Value = .Value End If End With Next End Sub Regards Claus Busch Click to expand... Thank you both joeu2004 and Claus. Pete
Hi Pete, Am Wed, 1 Jun 2011 08:25:16 -0700 (PDT) schrieb Pete: for TEXT formula in range("C1:C10"): Sub TextFormula() Dim rngCell As Range For Each rngCell In Range("C1:C10") With rngCell If Left(.Formula, 5) = "=TEXT" Then .Value = .Value End If End With Next End Sub Regards Claus Busch Click to expand... Thank you both joeu2004 and Claus. Pete