0
Thanks

A few words of thanks would be greatly appreciated.

Excel - Add data to new row each time data is entered




Issue


I've created a VBA form to enter dad like Names, numbers, date, time etc. Each time the form is run and data is entered it should be added to new row. The data entered is never duplicate so there is no need to verify that. But adding data to the next new row is my problem. I want the first 4rows of sheet to be headed row and so my dad should get added from 5th row. How do I do this?

Solution


Having not seen how you are doing it. All I can suggest is that find the last used row and add one to it. If the result if 4 or less then make it 5

If col A will always have data then you can use this to find last row

lastrow = cells(65536,1).end)xlup).row 

lastrow = lastrow + 1 

if lastrow < 5 then lastrow = 5

Note


Thanks to rizvisa1 for this tip on the forum.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Excel - Add data to new row each time data is entered », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

0 Comments