+ Reply to Thread
Results 1 to 16 of 16

Replicate Userform transfer to Worksheet with selected values

  1. #1
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Replicate Userform transfer to Worksheet with selected values

    Hello,

    I have the following userform which has the purpose to transfer data from it to a workbook using the below macro, which is working fine.

    EFH_4.PNG

    Please Login or Register  to view this content.
    Whilst this is working properly if, let's suppose, I have one entry at a time. However, I would like to prevent re-running the userform for more than 1 entry, which would be ultimately a very long process at the end.

    Therefore I have added a combobox which will select how many row (entries/replications) from the same supplier I would like to have transferred (pasted) on the workbook (data) and this should not be more than 12 (the first entry included).

    However, the first entry will always be the full transfer of the given data from the userform, that is, 10 different values from the userform pasted on the workbook. And when a number of replication is chosen, then only 7 userform values will be transferred onto the workbook from the subsequent transfer.

    What should I do to execute this based on the number of selected replication (row)?

    Here is an example of what I would like to achieve.

    Thank you very much for your help and contribution. Much appreciated as always.
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    Anyone could give some indication of how I might do this? Much appreciated.

  3. #3
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    I was thinking, perhaps using the Do...Until loop may be a solution but not sure yet. Any help would be much appreciated. Thank you.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Replicate Userform transfer to Worksheet with selected values

    As the information passing to the sheet is a duplicate all you need to do is add a snippet of code that copies that entry which has just been passed - excluding certain columns - and pastes it filling down the no of selections less one...

    No attachment so have nothing to work with...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    Hi Sintek,

    Oh yes, I like your suggestion and it does make more sense. How would I do the copy and paste by taking into consideration this code?
    Please Login or Register  to view this content.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Replicate Userform transfer to Worksheet with selected values

    Upload a sample file...

  7. #7
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    A slim down version
    Attached Files Attached Files

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Replicate Userform transfer to Worksheet with selected values

    Something like below...Also when making use of With always insert a point depicting...See red dots...Otherwise that code will refer to active sheet
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    Thanks Sintek, so do I have to add the syntax For ... Next for it to recognise how many time I would like it to be duplicated?

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Replicate Userform transfer to Worksheet with selected values

    No...add the red part....

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    Hey Sintek,

    Overall it is working but a slight issue: it is working when 2 and above is selected but then come back with error when it's 1 or nothing in the number of duplication (combobox 10).

    Thank you

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Replicate Userform transfer to Worksheet with selected values

    So....Make the selection only from 2-12 as 1 obviously defeats the purpose...
    add red snippet...
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    I did the following which is working as well. Will test yours now as it's much shorter...

    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    Dear Sintek,

    Yours is much shorter and definitely better. Thank you ever so much for your help and contribution.

    Best.

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Replicate Userform transfer to Worksheet with selected values

    Pleasure...For future reference...
    Tx for rep +
    Please Login or Register  to view this content.
    Last edited by sintek; 07-19-2019 at 09:19 AM.

  16. #16
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Replicate Userform transfer to Worksheet with selected values

    Brilliant ... Thanks

+ 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] Transfer Userform data on 1 worksheet to different worksheet (empty row = wrong sheet)
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2014, 10:08 AM
  2. Transfer of Values based on Selected Month
    By Weathertuck in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2014, 11:54 AM
  3. when a certain category is selected
    By finigan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2013, 02:08 PM
  4. Transfer Selected UserForm ListBox Items into a new Row
    By oumomof3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-25-2011, 02:02 PM
  5. Transfer of data from one worksheet to another when drop down selected
    By DJ_Rutts in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2010, 11:54 AM
  6. UserForm to Worksheet Transfer
    By JezLisle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2009, 01:07 PM
  7. [SOLVED] How to transfer selected cells' values into an array in VBA?
    By Julian in forum Excel General
    Replies: 6
    Last Post: 06-08-2006, 10:40 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