Home What is the VBA code to copy and paste the data range: D13:J31 within a table to the active cell row?
Reply: 0

What is the VBA code to copy and paste the data range: D13:J31 within a table to the active cell row?

RCF
1#
RCF Published in 2017-12-07 17:40:51Z

I am currently working on a project using User Forms please see the VBA code below:

Private Sub CommandButton1_Click()

    If TextBox1.Value = "" Then
        If MsgBox("Form is not complete. Do you want to continue?", vbQuestion + vbYesNo) <> vbYes Then
        Exit Sub
        End If
    End If

    ActiveCell = TextBox1.Value

    Const NumberOfRows = 19
    ' ...
    Range(ActiveCell, ActiveCell.Offset(NumberOfRows - 1, 0)) = TextBox1.Value
    ActiveCell.Offset(NumberOfRows, 0).Activate

    Call resetForm

End Sub

RESET FORM

Sub resetForm()

    TextBox1.Value = ""
    UserForm1.TextBox1.SetFocus

End Sub

So far I have been able to Create a Form, once the User inputs their data and clicks the User Form's command button, the output is inputted to the active cell (column C) and 18 more rows.

Now I would like this User Form to copy the Data range D13:J31 so that it conforms with the newly inputted rows.

I would like this to occur every time a User inputs new Data using the User Form the 19 rows are inputted alongside the D13:J31 data range.

Any help on this topic is much appreciated.

Kind Regards,

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308922 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO