I'm putting together a front end for Excel so that users can input data using a simple input page.
I've followed this tutorial and have a form that work but that is not quite clever enough for me.
This form takes the data and presents it in a blank line in Excel. The next data input will populate the next blank row.
What I really need if for it to determine if a value already exists (for example txtPart.Value) and if it does already exist to append or overwrite the data in that row.
I believe the basis for identifying the value is in the following code but I need help modifying it:
Any pointers would be really appreciated.
Cheers
I've followed this tutorial and have a form that work but that is not quite clever enough for me.
This form takes the data and presents it in a blank line in Excel. The next data input will populate the next blank row.
What I really need if for it to determine if a value already exists (for example txtPart.Value) and if it does already exist to append or overwrite the data in that row.
I believe the basis for identifying the value is in the following code but I need help modifying it:
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("PartsData")
'find first empty row in database
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
'check for a part number
If Trim(Me.txtPart.Value) = "" Then
Me.txtPart.SetFocus
MsgBox "Please enter a part number"
Exit Sub
End If
Any pointers would be really appreciated.
Cheers