+ Reply to Thread
Results 1 to 10 of 10

Transfer data to closed workbook based on more conditions

  1. #1
    Forum Contributor
    Join Date
    12-23-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2013
    Posts
    331

    Transfer data to closed workbook based on more conditions

    Hello,

    I would like to ask help to transfer date from openned workbook (sample2.xlsm) to closed workbook (sample1.xlsm) based on more conditions.
    The conditions are the followings:
    -Condition #1: if cell H1 of sample2.xlsm is available in sample1.xlsm in column B then Exit sub with message of "Exist number".
    -Condition #2: if cell H1 and G1 of sample2.xlsm are in sample1.xlsm (in the same row) then overwrite all other linked data in sample1.xlsm (in this row).
    -Condition #3: if cell H1 of sample2.xlsm is not available in sample1.xlsm then copy paste the values from sample2.xlsm to sample1.xlsm last row.

    Thank you in advance the feedback!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-11-2012
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    144

    Re: Transfer data to closed workbook based on more conditions

    Hi Villalobos,

    Please find attached the answers for your question.


    Note:

    Please put both files in same location or
    if the location or file name is different please update the below code to your need.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ravikumar,

    * Please Add Reputation if solved.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Transfer data to closed workbook based on more conditions

    Started on it and got interrupted and looks like I'm late to the party. But finished it anyway. See attached workbook. You can change for your needs but as of now code is written with assuming your Sample 1 file is in the same file location as this file.
    Attached Files Attached Files
    Last edited by mike7952; 02-18-2017 at 02:41 PM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Transfer data to closed workbook based on more conditions

    Hello mike7952,

    Have not had a change to ruffle your feathers yet.

    Started on it and got interrupted and looks like I'm late to the party. But finished it anyway.
    Finished what? An incomplete reply from a person with you outstanding qualities - (I thought)

    Pull up you socks, and maybe then, I shall consider continuing or friendship!

    W.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Transfer data to closed workbook based on more conditions

    Quote Originally Posted by Winon View Post
    Hello mike7952,

    Have not had a change to ruffle your feathers yet.



    Finished what? An incomplete reply from a person with you outstanding qualities - (I thought)

    Pull up you socks, and maybe then, I shall consider continuing or friendship!

    W.
    I'm really lost ?

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Transfer data to closed workbook based on more conditions

    @ mike7952,

    No problem really. Trying to pump some fun into the otherwise mundane "Yes Sir" and "No Sir"!

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Transfer data to closed workbook based on more conditions

    Oh lol, thought maybe I uploaded the wrong workbook, or code wasn't working.

  8. #8
    Forum Contributor
    Join Date
    12-23-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2013
    Posts
    331

    Re: Transfer data to closed workbook based on more conditions

    Hi Guys,

    Thank you very much your help!

    @mike7952
    I tested your code and working fine but I have 1 more issue... with letters..., I did not mention in my first post. In cell H1 of sample2.xlsm I could have mix of numbers and letters (e.g. 333A) in the future.

    Could you give me some advice how to modify your code in order to consider only the exact match?
    Last edited by Villalobos; 02-19-2017 at 04:13 AM.

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Transfer data to closed workbook based on more conditions

    Add Lookat:=xlwhole to the find

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    12-23-2013
    Location
    Hungary
    MS-Off Ver
    Excel 2013
    Posts
    331

    Re: Transfer data to closed workbook based on more conditions

    Thank you very much!

+ 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. Matching data from closed workbook with open workbook based on cell values
    By kbkrueger in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2015, 07:42 PM
  2. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  3. [SOLVED] Filling multiselect listbox based on closed workbook data
    By FKurzhals in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-23-2013, 02:56 PM
  4. Replies: 2
    Last Post: 02-20-2013, 12:40 PM
  5. Transfer Data from one workbook to worksheets in a closed workbook by criteria
    By jftapel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2012, 05:23 AM
  6. Transfer data into another closed workbook???
    By gidgetcds in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2012, 03:13 PM
  7. transfer data from open workbook to closed workbook
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 12-23-2008, 08:30 AM

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