Forum Discussion

Rashaud35's avatar
Rashaud35
Copper Contributor
Nov 05, 2022
Solved

Trying to use VBA to clear cell contents but not the formula/format from specified cell

I am using the following code to clear the contents of a row, as part of a "clear button" I've created in my spreadsheet, but there's one Cell in each row that has a quotient formula in it. I would l...
  • HansVogelaar's avatar
    Nov 05, 2022

    Rashaud35 

    Range("A9:J9").SpecialCells(xlBlanks).EntireRow is the same as Range("A9").EntireRow and as Rows(9).

    So there is no need to specify A9:J9 and SpecialCells(xlBlanks)

    You might use

    Rows(9).SpecialCells(xlCellTypeConstants).ClearContents

Resources