I am trying take copied data and paste it into another workbook with code.
Here is what I am working with:
Private Sub CommandButton1_Click()
If TextBox1.Value = "" Or TextBox2.Value = "" Or TextBox3.Value = "" Then
Exit Sub
End If
Range("H3") = TextBox1.Value
Range("I3") = TextBox2.Value
Range("J3") = TextBox3.Value
lastrow = Range("A3").End(xlDown).Row
Range("H3:J3").AutoFill Destination:=Range(Range("H3"), Range("J" & lastrow))
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Here is where I get stuck at...
End Sub
The other workbook would be specified in "TextBox4" of the same userform I use to add data to the page. I will be adding more data from multiple workbooks to the same workbook referenced in "TextBox4", so I need it to find the next empty cell in row "A" and paste the data as values.
Please let me know if you have any questions and thanks for any help.
Here is what I am working with:
Private Sub CommandButton1_Click()
If TextBox1.Value = "" Or TextBox2.Value = "" Or TextBox3.Value = "" Then
Exit Sub
End If
Range("H3") = TextBox1.Value
Range("I3") = TextBox2.Value
Range("J3") = TextBox3.Value
lastrow = Range("A3").End(xlDown).Row
Range("H3:J3").AutoFill Destination:=Range(Range("H3"), Range("J" & lastrow))
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Here is where I get stuck at...
End Sub
The other workbook would be specified in "TextBox4" of the same userform I use to add data to the page. I will be adding more data from multiple workbooks to the same workbook referenced in "TextBox4", so I need it to find the next empty cell in row "A" and paste the data as values.
Please let me know if you have any questions and thanks for any help.