+ Reply to Thread
Results 1 to 8 of 8

Code to copy from userform to logsheet not working, no error messages

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Code to copy from userform to logsheet not working, no error messages

    Hi everyone.

    Could someone please take a look at this code and tell me what I need to change to make it function. Background: Userform has info put into fields. After it is complete, user hit submit button which is tied to this:

    Please Login or Register  to view this content.
    I don't see any errors on this, but it is not copying the data to the logsheet.

    Any ideas?


    Thanks for your help.

    Patrick

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Code to copy from userform to logsheet not working, no error messages

    I don't see a problem with the code, though I have a few suggestions for cleaning it up a bit (see below). Try putting a debug stop at the beginning and step through it. Make sure it's putting the data where it should and find out what's happening to it.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Code to copy from userform to logsheet not working, no error messages

    Thanks for cleaning up the code for me Nate. I am still trying to figure out why it is not working. It seemed to quit around the same time I formatted the sheet as a table. Perhaps that has something to do with it.


    Patrick

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Code to copy from userform to logsheet not working, no error messages

    Patrick

    Are you sure the data isn't going onto the sheet?

    It could be but not going where you expect/want it to, take a look at the value of rw when you step through the code with F8.
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Code to copy from userform to logsheet not working, no error messages

    I am not quite sure how this happened, but my data was getting copied to the sheet, just starting at row 1000. I erased the data and tried again and it seems to copy fine. However, I have issues elsewhere. I am now getting a Type Mismatch error that is pointing back to another bit of code I have going. I am at a loss. When I fill out the userform and click the control attached to this:
    Please Login or Register  to view this content.
    It seems to complete and gets me to the message box. Clicking yes will error out Type Mismatch on this code:

    Please Login or Register  to view this content.

    Any ideas on what I need to do differently?


    Patrick

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Code to copy from userform to logsheet not working, no error messages

    Patrick

    How have you populated Combobox1?

  7. #7
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Code to copy from userform to logsheet not working, no error messages

    I have a named range "Infraction" on the Data_Sheet. I have is listed in the rowsource for my userform. The range does match the cells F2:G8.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Code to copy from userform to logsheet not working, no error messages

    There's no need to use VLookUp then.
    Please Login or Register  to view this content.
    Last edited by Norie; 12-12-2013 at 03:23 PM.

  9. #9
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Code to copy from userform to logsheet not working, no error messages

    Brilliant! Thank you so much Norie. Your code did the trick.

    Patrick

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Error Handling: Creating code to display error messages
    By Student1990 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-01-2013, 02:21 PM
  2. VBA code to copy Outlook Messages to excel
    By Ironman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-15-2011, 04:40 PM
  3. Turn Off Error Messages While Typing Code
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-03-2008, 11:18 AM
  4. error messages from check box code...
    By lottesfog in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-25-2007, 01:53 AM
  5. [SOLVED] error messages-Is there a way to show error messages
    By hans in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2006, 12:45 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1