• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to insert rows automatically in table at correct point sorted on date

kpku2020

New Member
Please see the attached sample file. I am trying to enter n number of transactions in the database table. I want to enter data in "Data Entry Table" which has only one row. Once I enter all the required data in this row of "Data Entry Table" and hit enter, the data should go into the "Database" table at the right place based on the date entered and dates already present in the Database table.

I would appreciate any help. Solution could be either formula/VBA (No knowledge) but not data entry forms which opens a small separate window.

Thank You.
Kaushal.
 

Attachments

  • Sample File.xlsx
    10.6 KB · Views: 10
Hi Kaushal,

Kaushal said:
Once I enter all the required data in this row of "Data Entry Table" and hit enter, the data should go into the "Database" table at the right place based on the date entered and dates already present in the Database table.

You mean to say when all the data get completed in all cell of Data Entry table data should go in Database table and get sorted as per date from say in ascending order?

Regards,
 
Hi
Thanks for looking into the problem.

@ Satish.digit The "Database" table can have duplicate dates. As this table is nothing but daily expense transactions. Thus a user can have multiple expense transactions on same date.

@Somendra Misra
No. I mean to say that once a user provides all the data in "Data Entry Table" and hit enter, the Data should be sent to "Database" table. And it should be inserted at the right place according to the date.

For e.g. If I have 2 transactions in "Database" table:
Sl. No. 1: Transaction 1 on 1-Apr-2014
Sl. No. 2: Transaction 2 on 1-May-2014


Now if I enter another transaction in "Data Entry Table" with date 10-Apr-2014 then it should be inserted above Transaction 2 at Sl. No. 2. Thus shifting this transaction from Sl. No. 2 to Sl. No. 3 position.

If I enter transaction in "Data Entry Table" with date 10-May-2014 then it should be inserted at Sl. No. 3 i.e. below Transaction 2.

I hope I am clear now. Still if there is any confusion please let me know.
 
@kpku2020

Thanks for those kind words.

Not a big code goes here.

I had use Worksheet_Change Event Macro on sheet1. It will check if input range is filled it will copy the data to database table and than sort it by date.

Go to VBA editor by pressing Alt+F11 and than go to sheet1. There you can find the code.

If you have any difficulty in understanding ping back .

Regards,
 
Back
Top