+ Reply to Thread
Results 1 to 9 of 9

Duplicate UserForm pasted info

  1. #1
    Registered User
    Join Date
    05-27-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    72

    Duplicate UserForm pasted info

    When I 'Submit' my userform it places the textbox entries onto a separate sheet in the first available row as intended.

    What I also would like it to do is duplicate the entries if a specific field is filled out so it essentially fills in the first 2 available rows instead of just one.

    What I have is a textbox named txtNew that when filled will assign a new serial number to the product identified in the form. I need to put in all the userform's info in one row under the original serial number and repeat right away with the new serial also. This is so that when searching for either serial number the user will be able to pull up record of the change.
    Last edited by nohero; 06-27-2011 at 10:03 AM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Duplicate UserForm pasted info

    Hi nohero

    I'm unable to get a clear picture of what you have...I'd suspect others haven't either. Please post a workbook that demonstrates the issues and your desired outcome.

    PLEASE include what code you currently have and illustrate this issue.
    What I also would like it to do is duplicate the entries if a specific field is filled out so it essentially fills in the first 2 available rows instead of just one.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Duplicate UserForm pasted info

    It's hard to answer without knowing what code that you use.

    Something like this, you need to specify which sheet the code writes to

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    05-27-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Duplicate UserForm pasted info

    Sorry for not including more, here's a good portion of the code I use to submit the userform:

    Please Login or Register  to view this content.

    So, submitting this form creates a new row of info on the "ActionLog" sheet. What I want to add to this is some kind of IF statement that will create 2 new rows of info on the "ActionLog" sheet instead of just 1, both containing the same info except the 2nd one replacing txtSerial2 with txtNew in column A. This would only happen if cboAction = "Replace" though.
    Last edited by nohero; 06-27-2011 at 08:37 AM. Reason: edit: added more of the code

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Duplicate UserForm pasted info

    My code should work if you adapt it slightly

  6. #6
    Registered User
    Join Date
    05-27-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Duplicate UserForm pasted info

    Quote Originally Posted by royUK View Post
    It's hard to answer without knowing what code that you use.

    Something like this, you need to specify which sheet the code writes to

    Please Login or Register  to view this content.
    I see where you're going with this. My code is already getting rather large for this section, with your solution it seems I'll have to double the size of the entire sub. Would it be possible to have the txtNew IF statement somewhere after all my other checks?

  7. #7
    Registered User
    Join Date
    05-27-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Duplicate UserForm pasted info

    Oh, I suppose I could put your code after my checks, as long as I start it before my section that actually writes the data.

    Let me try and play with it for a bit using your idea and I'll be back to post my results.

  8. #8
    Registered User
    Join Date
    05-27-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Duplicate UserForm pasted info

    Well after having a little trouble trying to get your code to fit with my existing work I stumbled across something while doing it wrong that made me realize I could just have my code re-check for the 1st available row AFTER the data was input once.

    Anyway, eventually solved my own problem while trying to follow your advice, thanks!

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Duplicate UserForm pasted info

    I can't test this, but give it a try

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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