Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi I have created a userform with the code as follow and I need to do two
things, first to check if the information entered in the user form already exist and secondly to have a calculation done in the user form ( they enter three different values and the 4th box give the total). I try to solve the first one as you will see in my code but it doesn't work. Thank you in Advance Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Projects") 'find first empty row in database iRow = ws.Cells(Rows.Count, 2) _ .End(xlUp).Offset(1, 0).Row 'check for a project number If Trim(Me.TxtProjectname.Value) = "" Then Me.TxtProjectname.SetFocus MsgBox "Please enter a project number" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 3).Value = Me.TxtProjectname.Value ws.Cells(iRow, 2).Value = Me.TxtClient.Value ws.Cells(iRow, 8).Value = Me.TxtImplementation.Value ws.Cells(iRow, 9).Value = Me.TxtConsulting.Value ws.Cells(iRow, 10).Value = Me.TxtDevelopment.Value If IsNumeric(Application.Match(Me.TxtProjectname, [c:c], 0)) Then MsgBox "INFORMATION ALREADY IN DATA SHEET" End If 'clear the data Me.TxtProjectname.Value = "" Me.TxtClient.Value = "" Me.TxtImplementation.Value = "" Me.TxtConsulting.Value = "" Me.TxtDevelopment.Value = "" Me.TxtProjectname.SetFocus End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Refer to control on userform from code module | Excel Programming | |||
working hotkey even if any control has focus in userform | Excel Programming | |||
Code not working when transfered into Userform | Excel Programming | |||
Using code to create a control on an Excel userform | Excel Programming | |||
Control code behavior with userform ? | Excel Programming |