I have a macro that I currently use to expand a worksheet as needed depending the amount of data input on a previous page. Since the data on the previous page can and will be changed often I need to use an Indirect function (or something similar) in the cell formulas on another page to always link to the same cell address (irreguardless of insert/delete for example).
However at times there can be a large number of rows that the code needs to loop over to set the formulas. The code that I am currently using is rather slow as it has to loop over each cell individually.
Any help as to optimizing the code to fill multiple cells at once similar to
versus the current method of
However at times there can be a large number of rows that the code needs to loop over to set the formulas. The code that I am currently using is rather slow as it has to loop over each cell individually.
Any help as to optimizing the code to fill multiple cells at once similar to
Code:
Range("A1","U1").Formula = "..."
versus the current method of
Code:
For Each vbCEll In Sheets("MTF Move-Check").Range("C" & Row, "R" & Row)
vbCEll.Formula = "=IF(INDIRECT(""'Sequence Macro'!" _
& Chr(Asc(Mid(vbCEll.Address, 2, 1)) - 1) & Row & _
""")<> """",UPPER(INDIRECT(""'Sequence Macro'!" & _
Chr(Asc(Mid(vbCEll.Address, 2, 1)) - 1) & Row & _
""")),"""")"
Next