View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default How to submit data from one sheet to another with a macro and butt

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Matt Brown" <Matt wrote in message ...
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.