Consulting

Results 1 to 4 of 4

Thread: Excel Userform VBA code to submit to worksheet

  1. #1
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    1
    Location

    Excel Userform VBA code to submit to worksheet

    After numerous You Tube videos and 'how to's' I have no shame in admitting i'm stuck! Here's hoping I can appeal to your better nature and ask for some help in getting the code I need for my Excel userform.

    I have an excel sheet and have created a userform to make data entry easier. So far so good and no problems. However I can't comprehend the code neeeded to submit the data from the form into the excel sheet. The form should be completed and then that data should create a new row of daata underneath the existing column headings

    The userform is comprised of one text box, 3 combo boxes and then 34 Yes/No check boxes. I have attached the spreadhseet and would be so appreciative if someone could take a look and at least get me going with the code I need to enter.

    Thank you so much in advance
    Attached Files Attached Files

  2. #2
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location

    See attached

    Here's a starting point.

    I would rename the checkboxes with a number at the end corresponding to the column the data goes into. This would make it easy for a for-next loop to fill the row with the Y/N values.
    Attached Files Attached Files
    Semper in excretia sumus; solum profundum variat.

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    All UserForm Controls have a Tag Property for general use by the Programmer. Put the column number in the Tag and then

    For each Ctrl in Me.Controls
       With Ctrl
          If .Tag <> "" Then Cells(RowN, .Tag) = .Value
       End With
    Next Ctrl
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    I've always wondered what the tag was for! Many thanks for the info, I wish I'd known about it years ago... would have saved me hours of work!
    Semper in excretia sumus; solum profundum variat.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •