How to submit data from one sheet to another with a macro and butt

G

Guest

I am doing a UI mockup and want to have a worksheet where data gets inputed
and then when the user is ready submits the data by clicking a button. At
this point the macro checks that all required fields have data (will
constrain the type using built in excel data type constraints) and enters it
into table on another sheet. When it enters the data in the table it enters
a new record and it creates a unique ID number in the table based on the
previous entries int value incrementing by 1.

I am looking for a short and sweet solution to this, if you have samples or
can point me at good ones I would be very grateful.
 
R

Ron de Bruin

Use the counta function

Sub test()
Dim myrange As Range
Set myrange = Worksheets("Sheet1").Range("A1:Z1")
If Application.WorksheetFunction.CountA(myrange) < _
myrange.Cells.Count Then
MsgBox "fill in all cells"
Exit Sub
End If
MsgBox "Your code"
End Sub


See this page for the copy part
http://www.rondebruin.nl/copy1.htm


Post the code you are using and I help you with the unique ID number
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top