Forum Discussion
Rashaud35
Nov 05, 2022Copper Contributor
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...
- Nov 05, 2022
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
HansVogelaar
Nov 05, 2022MVP
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