I am writing a macro that calls up another spreadsheet file consisting of column data. The macro will perform some
sort routines and simple additions and finally save the edited file as a new excel file. The new data file will need to
have a few formulas embedded. The area I am seeking help with is how to embed a few simple excel formulas in
certain cells. The task would be easy if the data file always had the same number of rows. However the number of
rows will vary and hence the location of the embedded excel formula is dependent upon the location of the "last" row
of data.
Basically looking for help to accomplish three aspects:
1) embed the excel function =SUM(A12:Axx) ... where xx is the 2nd to last row of data in column A
The embedded function will be located in Cell Azz ... where zz is the last row of column A
2) Cell(J1) needs the formula =Azz .. where this formula is embedded to display the value of (Azz)
3) Cell(K1) needs the formula =SUM(Axx:Sxx) .. where xx is the last row # and is used to display the Row Sum of Axx thru Sxx
The reason the embedded formulas are important for my project is because the newly saved spreadsheet will be modified manually by changing some of the data values. When the data values are altered by the user, the embedded formulas will calculate the
updated totals.
Thank you in advance for considering my dilemma as I am a novice desiring to learn more about coding of macros.
Any help or assistance is greatly appreciated.
Cheers
Bookmarks