VBA & Macro Problems

How to Append Customer Form Data to the Next Row in Excel using VBA

Tauseeq MagsiTauseeq Magsi Nov 11, 2026 869 views

Question details

The user needs a way to take customer details entered in separate vertical input cells and automatically append them horizontally to the next available row in an existing list or table.

How to Append Customer Form Data to the Next Row in Excel Using VBA
Product
Excel
Device & OS
not provided
Scenario
Setting up an automated data entry form where inputs are filled vertically and then migrated into a structured horizontal database list.
Observed behavior
Instead of manual copy-pasting and transposing, the goal is to automatically log the form's data into the next blank row in distinct columns.
Before you start

Before running any VBA macros, ensure your workbook is saved in a macro-enabled format (.xlsm) and that the Developer tab is visible on your ribbon so you can access the Visual Basic Editor.

Solution 1Recommended

Use a VBA Macro to Automate Appending Data

Write a VBA script to dynamically find the last used row in your table and transpose your vertical form inputs horizontally into it.

This method uses the End(xlUp) command to find the bottom of your current list and Application.Transpose to convert the vertical form entries into a horizontal row format.

1
Open the VBA Editor

Press the ALT + F11 keys on your keyboard to launch the Microsoft Visual Basic for Applications window.

2
Insert a new module

In the VBA Editor, click on 'Insert' in the top menu bar and select 'Module' from the dropdown list.

3
Paste the VBA code

Copy and paste the following code into the module window: Sub AppendData() Dim r As Long Dim arr As Variant arr = Application.Transpose(Worksheets("Input").Range("B3:B7").Value) With Worksheets("list") r = .Cells(.Rows.Count, "A").End(xlUp).Row + 1 .Cells(r, 1).Resize(1, 5).Value = arr End With End Sub

4
Customize the script to your workbook

Modify 'Input' to the name of your form sheet, 'B3:B7' to match your actual input cells, and 'list' to the name of your database sheet.

5
Run the macro

Close the VBA editor. Back in your workbook, press ALT + F8, select 'AppendData', and click 'Run' to transfer the current form inputs into the next blank row.

Use a VBA Macro to Automate Appending Data
Pro Tip: You can insert a shape or form control button on your 'Input' sheet, right-click it, and select 'Assign Macro' to trigger the script with a single click.

Build and Manage Data Entry Forms Seamlessly with WPS Spreadsheet

WPS Office Spreadsheet provides full support for VBA macros and advanced array formulas like TOROW. You can easily automate your customer data entries across thousands of rows without performance lags, entirely for free.

  1. 1. Download and install WPS Office: Get the official WPS Office software from the website and install it on your computer.
  2. 2. Open your Excel workbook: Launch WPS Spreadsheet and open your existing .xlsm or .xlsx file containing the customer data form.
  3. 3. Enable macros and execute: Navigate to the Developer tab, ensure macros are enabled, and run your automated data appending scripts flawlessly.
Full compatibility with Microsoft Excel (.xlsm) VBA scripts and macros.Supports dynamic array formulas including TOROW and TRANSPOSE.Free and lightweight alternative for robust spreadsheet data management.Familiar ribbon interface requiring no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my VBA macro overwriting existing table rows?

This happens if the code calculates the last row incorrectly. Ensure the column referenced in `Cells(Rows.Count, "A").End(xlUp).Row` contains data in every single row. If there are blank cells in column A, the macro might return a lower row number, causing it to overwrite existing entries. Consider using a column that is always filled as your reference.

Can I clear the form automatically after appending the data?

Yes. You can add a line of code at the very end of your VBA macro to clear the input fields. Before the `End Sub` line, insert `Worksheets("Input").Range("B3:B7").ClearContents`.

Does the TOROW function work in older Excel versions?

No, the TOROW function is exclusively available in Microsoft 365 and newer standalone versions. For older software versions, you should use the TRANSPOSE function entered as an array formula (by pressing Ctrl+Shift+Enter) or rely on the VBA macro solution.