+ Reply to Thread
Results 1 to 2 of 2

User Form to save Form entries & check for duplicates

  1. #1
    Registered User
    Join Date
    06-09-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    User Form to save Form entries & check for duplicates

    Hi,

    I have an UserForm; have written the below VBA code to create email Id from the form entries - firstname & lastname; eg: first name : Ravi last name: Kumar then it creates the email ID as [email protected].

    I need the VBA code that checks the user entries first & lastname and if the entry is duplicate it has to create an email id suffixing 1,2... say for ex: Ravi Kumar is entered again, it has to create the email ID as [email protected].

    Dim fname As String
    Dim lname As String
    Dim pro As String

    Dim FullName As String
    Dim mail As String
    Dim RwCnt As Long 'to get the last filled row in the sheet
    Dim ws As Worksheet
    Set ws = Worksheets("Data")


    iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row 'go to sheet, got to last row & first column

    fname = UserForm2.TextBox1.Value
    lname = UserForm2.TextBox2.Value
    pro = UserForm2.TextBox3.Value

    FullName = fname & " " & lname
    mail = fname & "." & lname & "@abc.com"


    Thanks.
    Last edited by KPK; 10-04-2010 at 06:22 AM. Reason: To explain the query clearly

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: User Form to save Form entries & check for duplicates

    KPK, as with your other recent question, you're just dumping a load of requirements that nobody can do much with. If you want help, you'll have to provide your data structure, a sample workbook, explain in context.

    This is not an on-demand free coding service. We're happy to help if you get stuck with your project, but you have to handle your part of the task, too!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1