Forum Discussion
jaolvera
Aug 16, 2023Brass Contributor
VBA Code to apply to certain cells
How do I apply this code only to certain cells, not the whole worksheet
HansVogelaar
Aug 16, 2023MVP
In the line
Set xRgVal = Cells.SpecoalCells(xlCellTypeAllValidation)
change Cells to the range you want to limit it to, for example
Set xRgVal = Range("D2:D100").SpecoalCells(xlCellTypeAllValidation)
jaolvera
Aug 16, 2023Brass Contributor
- HansVogelaarAug 16, 2023MVP
You forgot the quotes around the range address - see my previous reply for an example.