Efficient was to copy a formula from within MS Access with a Excel template open
I have the attached template where from within MS Access I will be pasting data from a recordset into the template columns A and B. What is the most efficient way to copy down the formula in col d ? My challenge is I do not know from day to day how many rows I will have to paste from MS Access to Excel.. In addition there is no guarantee I will have information in col c
From within MS Access
.Range("A2").CopyFromRecordset rs - This copys my data from MS Access into Col A-C
Note the Experts Exchange Attachment facility will not allow me to attach as template so I have attached it below as an Excel spreadsheet. Test-Template.xlsx
The formula already exists in my template. Do you think it will be more efficient to copy down the formula that will always exist in the first row. I can do a record count of my recordset from MS Access and then as an example copy down the formula from d1:d25 ?
The sample db you provided loops thru every single cell and perhaps that is more efficient, but that is what I am trying to determine...
Thus, in my example above I will dump the data from MS Access into Excel Col A-C. Then I left with col D where I need to paste down the formula...
Rey Obrero (Capricorn1)
if the formula already exist in the template (.xltx)
it will still be available to the newly opened excel file.
Rey..but it looks like in your db example rather than use the existing formula found in the first row of my attached tempate you are recreating the formula ?