I am trying to clear the values of cells in a certain range that don't have a formula. I tried the code below, and while it runs through the two loops without problems, it does not do what I want.
Am I wrong in assuming that the "HasFormula=False" should work? What is the proper way of asking Excel whether or not a certain cell contains a formula?
Has anyone got an answer for me?
Thanks
Bengt
(RangeName is defined as a string that contains the name of the area)
For Row = 1 To Maxrow
Application.StatusBar = String(Row, "*")
For Column = 1 To Maxcol
If Range(RangeName).Cells(Row, Column).HasFormula = False Then
Range(RangeName).Cells(Row, Column).Value = ""
End If
Next Column
Next Row
Am I wrong in assuming that the "HasFormula=False" should work? What is the proper way of asking Excel whether or not a certain cell contains a formula?
Has anyone got an answer for me?
Thanks
Bengt
(RangeName is defined as a string that contains the name of the area)
For Row = 1 To Maxrow
Application.StatusBar = String(Row, "*")
For Column = 1 To Maxcol
If Range(RangeName).Cells(Row, Column).HasFormula = False Then
Range(RangeName).Cells(Row, Column).Value = ""
End If
Next Column
Next Row