- For specific range to copy and paste, you only have to execute 2 rows of code for 1 time
If you loop through each cell to find the formula, you are executing 2+ rows of code for many times
Of course looping is much slower
- You cannot use find() in VBA. To locate the cell with formula xyz, for example to test range A1
InStr(Range("A1").Formula, "xyz")
Range.Formula returns the formula of the cell.
InStr check if the returned formula contains "xyz", return 0 if none, return a number (the starting location of xyz) if xyz is found
You can use InStr(Range("A1").Formula, "xyz")<>0 to identify the cells contain xyz