0% found this document useful (0 votes)
4 views1 page

Customer Data Entry Code

This document contains a VBA code snippet for a form that submits customer information to an Excel worksheet named 'Customers'. It captures details such as first name, last name, email, phone, company, status, and notes, and adds them to the next available row in the worksheet. The code also includes a message box to confirm successful addition and a cancel button to unload the form.

Uploaded by

ashugarg6547
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Customer Data Entry Code

This document contains a VBA code snippet for a form that submits customer information to an Excel worksheet named 'Customers'. It captures details such as first name, last name, email, phone, company, status, and notes, and adds them to the next available row in the worksheet. The code also includes a message box to confirm successful addition and a cancel button to unload the form.

Uploaded by

ashugarg6547
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Private Sub btnSubmit_Click()

Dim ws As Worksheet
Set ws = [Link]("Customers")

Dim nextRow As Long


nextRow = [Link]([Link], 1).End(xlUp).Row + 1

[Link](nextRow, 1).Value = nextRow - 1 ' Customer ID


[Link](nextRow, 2).Value = [Link]
[Link](nextRow, 3).Value = [Link]
[Link](nextRow, 4).Value = [Link]
[Link](nextRow, 5).Value = [Link]
[Link](nextRow, 6).Value = [Link]
[Link](nextRow, 7).Value = [Link]
[Link](nextRow, 8).Value = Date ' Created Date
[Link](nextRow, 9).Value = "" ' Last Contacted
[Link](nextRow, 10).Value = [Link]

MsgBox "Customer added successfully!", vbInformation


Unload Me
End Sub

Private Sub btnCancel_Click()


Unload Me
End Sub

You might also like