Hello,
I have a spreadsheet set up to take a cleansed report which I need to apply formula to.
The report size could change (i.e. the number of rows used will not be fixed, but the columns will).
The report is pasted into cell E1 and covers columns E to F.
In columns A, B, C and D - I would like to add the formula shown below so that the formula in each column is extended to the last row containing data in column E. The report itself is currently over 15,000 rows but it could be significantly bigger than this, so I'd like to copy the formula and paste as values, once they have been added to keep the size of the spreadsheet to a mimimum.
Any help with this would be much appreciated as anything that I've tried so far has resulted in Excel freezing (presumably because I don't know the most efficient way to write this code).
Thanks
David
' Column A formula
ActiveCell.FormulaR1C1 = "=IF(RC[4]=""Agent:"",RC[5],R[-1]C)"
' Column B Formula
ActiveCell.FormulaR1C1 = _
"=COUNTIFS(RC5:RC[3],""open the call appropriately"",RC1:RC[-1],RC[-1])"
' Column C Formula
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],RC[2])"
' Column D Formula
ActiveCell.FormulaR1C1 = _
"=IF(IF(ISERR(LEFT(RC[3],1)*1),"""",VALUE(LEFT(RC[3],1)))=0,1,"""")"
I have a spreadsheet set up to take a cleansed report which I need to apply formula to.
The report size could change (i.e. the number of rows used will not be fixed, but the columns will).
The report is pasted into cell E1 and covers columns E to F.
In columns A, B, C and D - I would like to add the formula shown below so that the formula in each column is extended to the last row containing data in column E. The report itself is currently over 15,000 rows but it could be significantly bigger than this, so I'd like to copy the formula and paste as values, once they have been added to keep the size of the spreadsheet to a mimimum.
Any help with this would be much appreciated as anything that I've tried so far has resulted in Excel freezing (presumably because I don't know the most efficient way to write this code).
Thanks
David
' Column A formula
ActiveCell.FormulaR1C1 = "=IF(RC[4]=""Agent:"",RC[5],R[-1]C)"
' Column B Formula
ActiveCell.FormulaR1C1 = _
"=COUNTIFS(RC5:RC[3],""open the call appropriately"",RC1:RC[-1],RC[-1])"
' Column C Formula
ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],RC[2])"
' Column D Formula
ActiveCell.FormulaR1C1 = _
"=IF(IF(ISERR(LEFT(RC[3],1)*1),"""",VALUE(LEFT(RC[3],1)))=0,1,"""")"