Help me !! - userform - update user info if frist,last name match

eric86vabeach

New Member
Joined
Jan 29, 2014
Messages
23
im working on a userform that updatas the data if the person fist and last name is in on the sheet in column B&C.

so what i would like to do is if the frist and last name match then it updates the row with textbox3,textbox4 ...ect

then it textbox5 adds
the "new info" the frist blank column after column "k"
then
then it textbox6 adds
the "new info" the next blank column after column "k"
and so till textbox8


---------------------------------------------

this is what i have so far

-----------------------------------------

Private Sub CommandButton1_Click()
Dim dataRow As Long

On Error Resume Next 'in case the data is new
'DataRow
dataRow = WorksheetFunction.Match(TextBox1.Value, TextBox2, .Range("B:B"))
'add a new row if not found in current data
If dataRow = 0 Then dataRow = .Range("B" & .Rows.Count).End(xlUp).Row + 1
'Export Data to worksheet
.Cells(dataRow, 1).Value = Date
.Cells(dataRow, 2).Value = TextBox1.Value 'frist name
.Cells(dataRow, 3).Value = TextBox2.Value 'last name
.Cells(dataRow, 4).Value = TextBox3.Value 'phone# ---- update if not same
.Cells(dataRow, 5).Value = TextBox4.Value 'email ---- update if not same
.Cells(dataRow, 6).Value = TextBox5.Value 'new info ---- update if not same
.Cells(dataRow, 7).Value = TextBox6.Value 'new info ---- update if not same
.Cells(dataRow, 8).Value = TextBox7.Value 'new info ---- update if not same
.Cells(dataRow, 9).Value = TextBox8.Value 'new info ---- update if not same

End With
End Sub

--------------------------------------------------------------------------------------------------


any tips or links would help me out
thanks for your time and reading this
-eric-
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You'd be much better off giving each person a unique ID and just using that as your reference point, that way you only need to look for a single value and you can change the names. Names Can and Do Change
 
Upvote 0
You'd be much better off giving each person a unique ID and just using that as your reference point, that way you only need to look for a single value and you can change the names. Names Can and Do Change


no it needs to be the name due this would be back office work and employees cant recall all the unique ID that are assign to the cusomers... its ok if they change there names if that happends then we could go in the data and change it we only have about 10-40 people change their names a yr and we have over 5000 peoples names that are customers
 
Upvote 0
So make a number up for them for each name they add - there's no reason the person inputting the data ever need see it or know about it
 
Upvote 0
I'd put an extra step in that allows for the searching of a name, otherwise a different spelling will mean that you add a new customer rather than updating the existing record.
 
Upvote 0

Forum statistics

Threads
1,216,212
Messages
6,129,546
Members
449,515
Latest member
lukaderanged

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top