+ Reply to Thread
Results 1 to 7 of 7

VBA to copy a cell value from one workbook to another workbook automatically

  1. #1
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    VBA to copy a cell value from one workbook to another workbook automatically

    Hi I have been struggling creating a VBA code that will do the following:

    I have two spreadsheets and would like to copy the value in WB1 (column/row) AD26 which is “Y” based upon the person’s name in C3 (WB1) and the course name in D3 (WB1) and automatically open WB2 (C:\document\training.xls), which has one worksheet (“trainingcoursecompleted”) has all the people names (column A) and the courses they have taken (column B) and paste the value (“Y”) in the cell that matches the name in WB1 (C3) and course name D3 (WB1) then closes the WB2 automatically.

    I am hoping you understand what I am trying to accomplish but if I am not clear please let me know so I can try and explain in more detail.

    I am hoping that someone can help me as I am totally lost in how to create this VBA or if it can even be done.

    Kris

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: VBA to copy a cell value from one workbook to another workbook automatically

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    To add a file to a new post

    To add a file to an existing post.

  3. #3
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    Re: VBA to copy a cell value from one workbook to another workbook automatically

    As request please find attached 4 spreadsheets first two are BEFORE and the other two are AFTER. Ideally on the Verification-Template spreadsheet when a "Y" is entered into AD26 it would automatically open the TestTraining spreadsheet and put the "Y" under the name of person and the name of the Verification (in this case GIS New Business), automatically save and close the TestTraining spreadsheet

  4. #4
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    Re: VBA to copy a cell value from one workbook to another workbook automatically

    The actual worksheets to use on the Verification Template workbook is the VerificationA worksheet

  5. #5
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    Re: VBA to copy a cell value from one workbook to another workbook automatically

    I was able to create the below code which will open the other workbook but I do not know how to get it do it automatically when a "Y" has been input in a drop down menu or how to match the name of the person to the name of the verification. Any help is really appreciated.


    HTML Code: 

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: VBA to copy a cell value from one workbook to another workbook automatically

    How is the name determined?

  7. #7
    Registered User
    Join Date
    11-14-2014
    Location
    Victoria
    MS-Off Ver
    2010
    Posts
    23

    Re: VBA to copy a cell value from one workbook to another workbook automatically

    The spreadsheet "test training" has all the names of the people in the company already in place (however if there is a new employee it would be great if the person's name would automatically get added at the end from the "BEPE-..." spreadsheet and the results inputted)
    The spreadsheet "BEPE-....", every time a new training is started the trainer inputs the persons (trainee) name in C2 and the the name of course they are being trained in M2 and when the trainee pass the course a "Y" gets input in AD26 then the code should automatically open up the "test training" spreadsheet, find the person's name from C2 and the course name from M2 from the "BEPE -...." spreadsheet in the Test training spreadsheet and put a "Y" in the cell under the course name and person name, automatically save the "test training" spreadsheet and close the "test training spreadsheet.

+ 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. Automatically Copy Data from Workbook - Main Workbook
    By BigBobBobson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2015, 06:59 AM
  2. Search cell values from range in another workbook and copy found row to a 3rd workbook.
    By SierraKilo78 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2014, 01:09 PM
  3. Automatically save file with cell value + copy cell values to other workbook
    By notquitetheguru in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2013, 07:04 AM
  4. Copy over new data from 1 workbook to another workbook and vica versa Automatically
    By jedemeyer1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-20-2013, 06:17 AM
  5. Replies: 0
    Last Post: 01-14-2013, 11:09 AM
  6. Copy data from one workbook to another workbook regularly (automatically)
    By hrhr2 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-03-2013, 09:31 AM
  7. [SOLVED] copy active sheet, create new workbook, name new workbook based on cell reference
    By jm0392 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2012, 07:12 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