# Microsoft Office Application Help - Excel Help forum > For Other Platforms(Mac, Google Docs, Mobile OS etc) >  >  Add userform data into first empty row on sheet

## Nitefox

I am looking for some code that I can add to a command button on my userform that will do the following:
Find the first empty row in column C on the sheet 'EquipmentData'. On that row add the data from the userform in the drop down box called RentalHouse into column A, text box SerialNumber into column B, and text box  ItemDescription into column C.

Thanks,
James

----------


## mehmetcik

Hi James

Can you post your spreadsheet for me?

I would avoid nameing your textboxes in future.

I have a userform with 64 textboxes.  I use a loops to read them and write them. 4 lines each.

----------


## Nitefox

The form is called NewItem. Spreadsheet is attached.
Thank you for your time.

----------


## mehmetcik

Hi




```
Please Login or Register  to view this content.
```

----------


## Nitefox

I used the second set of code since I dont want to go to the EquipmentData sheet. At first it appeared to work correctly when I was already viewing the EquipmentData sheet. However when i ran the user form when not viewing the EquipmentData sheet, it did not enter the data into the first empty row at the bottom, it appeared to randomly write the data over other records. There is a total of about 1700 records. The first time I did it it put the data on record 1498, the second time it put it on record 6, and the third time it put in on record number 42.
I have attached my spreadsheet.
(run the user form NewItem, enter data into the three boxes and click Add & Exit)

----------


## mehmetcik

Your Spreadsheet is too complex for me to see what you are doing.

Try this ammendment:-




```
Please Login or Register  to view this content.
```

----------


## Nitefox

That workbook returns the same results I was getting. If you view say the ReturnData sheet then run Macro1 it enters the data into a random row on EquipmentData (not the last empty row). However if you run the macro while the EquipmentData sheet is viewed then it works fine.

----------

