Putting userform Data into a different worksheet

SamAllerton

New Member
Joined
Mar 25, 2015
Messages
2
Hi all,

I'm having trouble getting my userform to enter data into a worksheet that is different to the worksheet the UserForm was opened from.

Basically on my 1st worksheet I have a macro that opens the User form and what I want to happen is that when I enter the data into the user form it transfers it to the 1st worksheet rather than the one I want it to go to.

Here is the code I'm trying to use:

Private Sub cmd_Enter_Click() Dim i As Integer

'position cursor in the correct cell "ADMIN_UserFormEntry!"A3.
Range("ADMIN_UserFormEntry!A2").Select
i = 1 'set as first ID

So when I enter the data it says "Select method of range class failed and highlights the line Range("ADMIN_UserFormEntry!A2").Select

It works fine if I put just "A2" as the range but this then enters data onto the first worksheet rather than the worksheet titled "ADMIN_UserFormEntry" which is where I want it to go.

Any help welcome!!

Thanks

Sam
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You shouldn't need to select the sheet/range to work with it but try

Code:
Sheets("ADMIN_UserFormEntry").Select
Range("A2").Select
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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