• 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...

  • 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

delta

Member
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
 

Attachments

  • PSC_UserForm.xlsm
    156.7 KB · Views: 11
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:
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
 

Attachments

  • Simple Database.xlsm
    19.9 KB · Views: 4
@delta

Please remember that while it's certainly and allowed and encouraged to post the same question on different forums (aka cross-posting), we ask that you provide the links to the question, so all may see if the question has already been answered.

https://www.excelguru.ca/forums/showthread.php?8945-multiple-TextBox-data-add&p=36840#post36840

also the same question reworded at:
https://www.mrexcel.com/forum/excel-questions/1052471-cell-range-instead-active-cell.html
https://www.ozgrid.com/forum/forum/help-forums/excel-vba-macros/1201795-last-blank-rows-count
 
Back
Top