Using Active X Controls to copy and paste between Worksheets

craigs23

Board Regular
Joined
Apr 25, 2012
Messages
65
Hi All,

I am currently working on a project, where I woudl like to use a worksheet as a data entry tool instead of a userfrom.

I am looking to use active X controls and will fromat the input sheet to resemble a userform.

So far I have managed to tweak some lines of code that I found that once attached to a command button will take the data from indivdual cells and paste it into the next empty row on a different worksheet.

I would also like to add a couple of text boxes into the data entry so that the op can add more detailed information.

However what I can't seem to grasp is how to add to the code to allow me to copy the individual cell data and also copy the Textbox contents and then past them into the new sheet on the same line.

I have attached the code I already have (that copies and pastes cell data) below:

Code:
Private Sub CommandButton1_Click()
Dim LR As Long, i As Long, cls
cls = Array("A2", "B3", "C2", "D3", "E2", "F3")
With Sheets("Sheet2")
CommandButton2_Click
    LR = WorksheetFunction.Max(1, .Range("A" & Rows.Count).End(xlUp).Row + 1)
    For i = LBound(cls) To UBound(cls)
        Me.Range(cls(i)).Copy Destination:=.Cells(LR, i + 1)
    Next i
End With
End Sub


Can anyone Help?

Thanks in advance
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top