View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Eduardo Eduardo is offline
external usenet poster
 
Posts: 2,276
Default can this be done?

Hi,
yes you can make a field mandatory

'check for a project number
If Trim(Me.TxtProjectCode.Value) = "" Then
Me.TxtProjectCode.SetFocus
MsgBox "Please enter a project number"
Exit Sub
End If

To your first question you have to tell where to put the information

'copy the data to the database
.Cells(iRow, 4).Value = Me.TxtProjectname.Value

where 4 is the column where you want the information

To get the first row free

Dim ws As Worksheet
Dim iRow1 As Long

Set ws = Worksheets("Projects")

'find first empty row in database
With ws
iRow = .Cells(.Rows.Count, 3).End(xlUp).Offset(1, 0).Row

if this helps please click yes, thanks

"sam" wrote:

Can we create forms in excel that would populate the corrensponding fields in
excel sheet? Also if we could create forms, can we make certain fields to be
mandatory?

Thanks a Lot in advance