• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Userform - Option Button

sn152

Member
Good Morining All,

I am trying to transfer data from a userform to a worksheet. I am able to transfer the data that is in the textboxes. But Iam unable to get the data for option button transfered to sheet1.


Let me explain it in detail.

I have a userform with 2 textboxes, 5 option buttons and 2 command buttons(Submit and retrieve). Now what I want to do is when I enter the Emp ID in the textbox1,and emp name in textbox2 and then I will select one of the option buttons and then i will click Submit. When I click submit this data should be transfered to sheet1 in the respective columns for optionbuttons - the data should be shown in the column "D" of sheet1).


When I enter the ID and click retrieve it should pull the existing data in sheet1 to the userform.


Kindly help me with this.


Thanks in advance.
 

Attachments

  • Sample.xlsm
    16.7 KB · Views: 8
Hi Somendra,

Thank you for helping me. Please see the attached file. I have added the code to my original file. But there is only one small problem. I enter the id and other details and then click on submit. So the data gets transferred to sheet 6. Again I enter the same Id and then click on the date shown in the listbox1 for that ID and then click on retrieve button. It pulls the data back to the form. Now I edit the data in the form and again click on submit. Now another line item is getting created in the sheet6 for the same id. But what I want is to edit the existing line item without creating a new one for that ID. The IDs are on sheet3.

Is there a way to fix this? Please help me...

Thanks in advance... :)
 

Attachments

  • Sample1.xlsm
    37.7 KB · Views: 7
Your file is not fully functional. As I am not getting Associate name plus if I enter an Id say 1 and press retrieve it is giving message please enter date. Now where to enter date?

Regards,
 
Hi Somendra,

You have to enter the EMP ID that is shown in the sheet 3. After entering it, fill all the fields in the form and click submit. After clicking submit, again enter the same ID in the userform. Once you enter the ID the listbox will show a date. select that date and click on retrieve.
Now try editing the retrieved data in the form and again click on submit. Now another line item is getting created in the sheet6 for the same id. But what I want is to edit the existing line item without creating a new one for that ID.

Thanks!
 
Hi Somendra,

Thank you for helping me. But I get an error in this. Please see the attached.

Thanks!
 

Attachments

  • Error.xlsx
    86.4 KB · Views: 5
Back
Top