+ Reply to Thread
Results 1 to 9 of 9

randomly entering strings from one worksheet to another

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    37

    randomly entering strings from one worksheet to another

    Hi,

    A bit of a sticky one! See attached the excel spreadsheet. I am trying to copy and randomly paste the data from 'new employees' worksheet into the cells denoted 'SPARE' in the 'schedule' worksheet. Is there a VBA code that can help me magically do this? This data given within the attached excel document is only a small (un-confidential) selection of the data I will actually be manipulating in this way. At present I do this manually, a very long and lengthy process... Any help would be greatly appreciated.

    cheers!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: randomly entering strings from one worksheet to another

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 06-09-2014 at 08:00 AM.

  3. #3
    Registered User
    Join Date
    07-01-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: randomly entering strings from one worksheet to another

    Wow that's fantastic! Thanks very much.

    Is there a way, however, so that each new employee i.e. 'GOU-FF1' is only entered once into the schedule? Additionally, if there is no "SPARE" cells to copy the new employees too can it bring up a message box to let the user know to create a new training program?

    I really really appreciate your help - you are shaving days off my work load!! Love excel!

  4. #4
    Registered User
    Join Date
    07-01-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: randomly entering strings from one worksheet to another

    Is there a way for it to select any length of data in the 'New Employees' Worksheet? As new employees could be longer than 10 rows of data, the amount is varied each time.

    Cheers!

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: randomly entering strings from one worksheet to another

    It should already account for varying length of new employees. Try:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 06-10-2014 at 07:53 AM.

  6. #6
    Registered User
    Join Date
    07-01-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: randomly entering strings from one worksheet to another

    Thanks very much for your code, its working in that it copies over all employees regardless the number of employees. You are making my life a million times easier.

    However, it seems to wipe the SPARE from cells that are SPARE and not filled, then call the message box, even though technically there are still 'SPARE's, see attached the workbook. Is there a way to prevent this from happening? it still appears to duplicate some of the employees. The Before worksheet is how the schedule looked before the macro is run, and the employees to add before is how the employees are entered before the macro is run.

    I really appreciate all your help.

    Cheers,
    Lbesley
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: randomly entering strings from one worksheet to another

    Try:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-01-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: randomly entering strings from one worksheet to another

    amazing!! works fantastically - thankyou thankyou thankyou

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: randomly entering strings from one worksheet to another

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9 and mark this thread as 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. Datalabel.Text randomly returns empty strings in a recursive function
    By Miragel in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-17-2012, 06:17 PM
  2. Randomly sample 30 columns from worksheet input and print them in worksheet Output
    By Savan87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2012, 01:00 PM
  3. Replies: 6
    Last Post: 08-16-2012, 10:02 AM
  4. macro to cycle through randomly named worksheet in workbook
    By benji* in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2011, 05:15 AM
  5. Replies: 1
    Last Post: 03-09-2006, 04:00 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