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
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