Results 1 to 4 of 4

Thread: Sheet code to copy & paste a new row of Info to another sheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Sheet code to copy & paste a new row of Info to another sheet

    Good day all,

    I have a userform that once completed uses a command button to send all data to a record sheet ("Form") into a single Row format, It is then assigned a unique number, however I also require this data, in single Row, to be sent from ("Form" - A1:01) to a second sheet ("SWMS" - A1:01), please see my code below & as always any assistance would be greatly appreciated, thank you all & have a great day - Marco


    Code:
    Private Sub cmdProcess_Click()
        
    Dim LastRow As Object
        Set LastRow = Sheets("Form").Range("a65536").End(xlUp)
        
        Sheets("Form").Unprotect Password:="000"
        LastRow.Offset(1, 0).Value = TextBox1.Text
        LastRow.Offset(1, 1).Value = TextBox2.Text
        LastRow.Offset(1, 2).Value = TextBox3.Text
        LastRow.Offset(1, 3).Value = TextBox4.Text
        LastRow.Offset(1, 4).Value = TextBox5.Text
        LastRow.Offset(1, 5).Value = TextBox6.Text
        LastRow.Offset(1, 6).Value = TextBox7.Text
        LastRow.Offset(1, 7).Value = TextBox8.Text
        LastRow.Offset(1, 8).Value = TextBox9.Text
        LastRow.Offset(1, 9).Value = TextBox10.Text
        LastRow.Offset(1, 10).Value = TextBox11.Text
        LastRow.Offset(1, 11).Value = ComboBox1.Text
        LastRow.Offset(1, 13).Value = TextBox12.Text
        LastRow.Offset(1, 14).Value = TextBox13.Text
        Sheets("Form").Protect Password:="000"
        
        MsgBox "SWMS Processed"
    End Sub
    Last edited by Ken Puls; 2012-10-24 at 05:27 PM. Reason: Cleaned up code

Posting Permissions

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