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

Assistance for Textbox Macro to update data one below the other

Bimmy

Member
Hi,

I'm using below code in a userform to update data in specific columns.


Code:
Const F = "dd-mm-yy hh:mm"

Private Sub CommandButton1_Click()
    N% = Val(TextBox11.Text)
    If N < 1 Then TextBox10.SetFocus: Beep: Exit Sub
    V = [{8,11,12,13,16,19,20,21,22,23}]
    r& = Sheet2.Cells(Sheet2.Rows.Count, V(1)).End(xlUp)(2).Row
For c% = 1 To UBound(V)
    Sheet2.Cells(r, V(c)).Resize(N).Value = Me.Controls("TextBox" & c).Text
    Me.Controls("TextBox" & c).Text = ""
Next
    UserForm_Initialize
End Sub

Private Sub TextBox2_Enter()
    TextBox2.Text = Format$(Now, F)
End Sub

Private Sub UserForm_Initialize()
    TextBox3.Text = Format$(Now, F)
    TextBox11.Text = "1"
End Sub
Private Sub TextBox4_Enter()
    TextBox4.Text = Format$(Now, F)
End Sub

Currently the macro is only updating data once, every time it is run.

I'm looking for an addition to the above code which will update data every time the code is run

Kindly assist in any way possible
 
Back
Top