ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   can this be done? (https://www.excelbanter.com/new-users-excel/234880-can-done.html)

Sam

can this be done?
 
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

Eduardo

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



All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com