1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Add Data macro

Discussion in 'VBA Macros' started by delta, Apr 15, 2018 at 2:28 PM.

  1. delta

    delta Member

    Messages:
    98
    data add from multiple text box in worksheet "DATA"
    in given macro do not work what is correction in macro
    i attache the sample file

    Attached Files:

  2. Logit

    Logit Active Member

    Messages:
    164
    Here is a sample database. Although there are only a few fields to fill in from the User Form ... the process can be expanded to accommodate as many fields as needed. Such as the form you are implementing :

    Code (vb):
    Option Explicit
    Private Sub btnCancel_Click()
        Unload Me
    End Sub

    Private Sub btnOK_Click()
        Dim ws As Worksheet
        Set ws = Worksheets("Customers")
        Dim newRow As Long
        newRow = Application.WorksheetFunction.CountA(ws.Range("A:A")) + 1
        ws.Cells(newRow, 1).Value = Me.txtFirstName.Value
        ws.Cells(newRow, 2).Value = Me.txtSurname.Value
    End Sub
    Sub CommandButton1_Click()
        Selection.EntireRow.Delete
    End Sub
     

    Attached Files:

Share This Page