VBA Code to apply to certain cells

Brass Contributor

How do I apply this code only to certain cells, not the whole worksheet



5 Replies


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)

Thank you! this error popped up when I go to enter data into the cells after@Hans Vogelaar 




You forgot the quotes around the range address - see my previous reply for an example.

I just added the quotes and the same error is populating
nevermind it worked