+ Reply to Thread
Results 1 to 5 of 5

VBA 2013 Random Text to different Sheet transfer on click

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    VBA 2013 Random Text to different Sheet transfer on click

    Good day to all,
    Been awhile since I’ve played around VBA and seem that when you’re out and about doing other things, well…
    Ok so just wondering if someone would know about how to do this.

    In my tab (Sheet “random”) I have a column (A) going to 100, with different text in them.
    I need to create a vba function that with randomly grab those 100 text from this column and add them to my tab Sheet (“Text”), same column. But they need to be randomised every time I click on the command button.

    Help would be much appreciated.

    So an example:

    Sheet(“Random”) Column A1 to A100, randomly copy and paste to Sheet(“Text”) Column A. No titles so A1 (On CommandButton1_Click)

    Excelnoub
    Click the star icon in the lower left part of the contributor's post and add Reputation if we have helped you .

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: VBA 2013 Random Text to different Sheet transfer on click

    The easiest way would be to:
    Copy whole range.
    fill next column with =rand() formula
    sort both columns on column B
    delete contents of column B.
    If there is something before in column B then start with inserting empty column and delete it at the end
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: VBA 2013 Random Text to different Sheet transfer on click

    So the code for the button could be something like:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: VBA 2013 Random Text to different Sheet transfer on click

    Holy … Yup exactly what I needed, thank you so much Kaper

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: VBA 2013 Random Text to different Sheet transfer on click

    Glad to hear so and thanks for reputation point and for marking thread solved

+ 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. Transfer Input Data from Sheet 1 to Sheet 2 on button click
    By Daniel Pilgrim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2019, 03:24 AM
  2. Replies: 1
    Last Post: 08-20-2015, 01:12 AM
  3. Replies: 2
    Last Post: 08-19-2015, 05:13 PM
  4. Transfer data from different sheets to database sheet by click of a button (VBA)
    By Rudidw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2015, 09:03 AM
  5. [SOLVED] Sheet 1 button click resulting in random sheet 2 selection
    By Summers1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 05:31 AM
  6. Automatically transfer data from one sheet to another in a workbook - Excel 2013
    By WGBarry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2013, 01:03 PM
  7. Click on a cell transfer to a different cell on a different sheet
    By dkim2586 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2011, 06:21 PM

Tags for this Thread

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