Forum Discussion
CZeus
Feb 17, 2023Copper Contributor
Need help with macro to autofill rows
Hello, I am trying to write a macro, and I am not used to VBA nor do I have much experience writing code to begin with, however I found some code from other posts that almost gets the job done that I...
HansVogelaar
Feb 17, 2023MVP
By the way, do you really want the formula in column P to return text values "1", "2" and "3"?
If it should return numbers 1, 2, 3, change the line
Range("P2:P" & m).Formula2 = "=IF(AND(O2>=Q$1,O2<Q$2),""1"",IF(AND(O2>=Q$2,O2<Q$3),""2"",""3""))"
to
Range("P2:P" & m).Formula2 = "=IF(AND(O2>=Q$1,O2<Q$2),1,IF(AND(O2>=Q$2,O2<Q$3),2,3))"- CZeusFeb 17, 2023Copper Contributor