can this be done?

  • Thread starter Thread starter sam
  • Start date Start date
S

sam

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
 
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
 
Back
Top