0

As the title suggests I am trying to add data into a new row through a userform. The problem I am having is that the layout out is as such:

Title Jan feb mar apr may jun jul aug sep oct nov dec Total income (Here needs to be where the data is inserted) Outgoing (again, another set of data needs to be added here)

What is the code to achieve this as currently it is going below outgoing but I want it in between income and outgoing

I am happy to discuss if you need more information.

Thanks in advance

1
  • What code do you have as of now? (StackOverflow does not code entire solutions for you - it helps you with issues) Commented Oct 1, 2014 at 12:06

1 Answer 1

2

You provided too little details with what you are exactly struggling. I can suggest the following: 1. Create a UserForm with as the columns as textboxes. 2. Add a button to the UserForm. When clicked find the last row in the worksheet (http://www.ozgrid.com/VBA/ExcelRanges.htm) and insert the values from each textbox.

Here are some links to get you started:

  1. UserForms: http://www.excel-easy.com/vba/userform.html
  2. Manipulating cells: http://msdn.microsoft.com/en-us/library/office/ff838238(v=office.15).aspx
Sign up to request clarification or add additional context in comments.

2 Comments

the part I am struggling with is getting the button to insert a new row always at A2 (for example) and then again 1 row above the last row in the work sheet.
Add a new row at A2 - Range("A2").EntireRow.Insert Shift:=xlDown. If you want to add a row 1 row above the last in the worksheet Range("A1").End(xlDown).EntireRow.Insert Shift:=xlDown (where A1 is the first cell in the worksheet from which you will be searching down for the first empty cell)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.