| || |
Adding data to excel sheet
Is there a way where I can append or add data to an existing excel sheet? Letís say that I have already an excel sheet with rows 1 Ė 25 filled with data. Now what I need to do is that open this sheet, and add the data to the 26th row not to start from the beginning of the sheet. I have the code to open the excel, but I need a sort of a function to determine the end of the document and add the new data to the last row.
Re: Adding data to excel sheet
You may use the usedrange function of VBA for this:
For the moment I am not writing the whole code given the fact that you already have functions to open the excel and stuff.
Here are the steps that can help you achieve this functionality:
1. Open the excel and determine the end of file by:
totalrows = ActiveSheet.UsedRange.Rows.Count
2. Increment this variable and add your data.
Hope this helps;
Anupreet Singh Bachhal