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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,215,132
Messages
6,123,227
Members
449,091
Latest member
jeremy_bp001

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