+ Reply to Thread
Results 1 to 24 of 24

Need help to Find the match then enter the value fr WB to WB after Double_Click

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hello All,
    I'm looking for method how to copy the value from the cell then open another wb, seraching same data and enter the missing value after Double_Click. Please look at the sample in attached.

    Pls also see code in below for your reference and you may help me with a good code:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by tuongtu3; 06-07-2013 at 12:45 PM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    put this into the worksheet module where you have the data you want to doubleclick, adapt the path/filename and the name of the target worksheet name, works for data in column K:
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi Tehnexus,
    The wbMstr is not open after I double click at column K (I did change to my path/File)

    Please Login or Register  to view this content.
    Regards,
    tt3
    Last edited by tuongtu3; 06-07-2013 at 02:26 PM. Reason: spelling

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,

    the target workbook is closed after the value was copied
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi Tehnexus,
    I meant the wbMstr is never open after I double click at column K (I did change to my path/File).

    Regards,
    tt3

  6. #6
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Double click the yellow marked cell in: wbThis.xlsm

  7. #7
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi Tehnexus,
    The wbMstr now is open but the value is not transferred. I did a little changed is moved one column to the left. Can you take a look at sample and revise.

    Regards,
    tt3
    Attached Files Attached Files
    Last edited by tuongtu3; 06-07-2013 at 07:40 PM.

  8. #8
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi Tehnexus,
    I have figured it out but do you know why the code does not Loop for the second , third same data until the last row?

    Please Login or Register  to view this content.
    Regards,
    tt3

  9. #9
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    I have figured it out but do you know why the code does not Loop for the second , third same data until the last row?
    The loop is left when data is copied assuming your data in unique defined by the 2 keys we are macthing
    Please Login or Register  to view this content.


    Any change in the structure need also to be done in the code...
    try with the structure in post #7

    Please Login or Register  to view this content.
    Last edited by tehneXus; 06-08-2013 at 03:29 AM.

  10. #10
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi Tehnexus,
    My question is not clear. I meant if there's two or three rows has the same data 123456 & ABCDEF1 in the wbMstr then the code should transfer the value to those rows as well. But the current code only transfer to the first row only.

    Another question: How to modify to copy the entire row of target and paste to another wbData then delete the entire row at post# 1
    Please Login or Register  to view this content.
    Regards,
    tt3

  11. #11
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,

    This will not stop after one copy in case you have more than one record like this, and will copy the entire row to the next free row a 3rd book called wbData.Sheets(2) and remove the target (double clicked) row:
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi Tehnexus,
    The code works fine and now I try to modify some like below but it's not working. Do you know why?
    This text "This info is from website." appears more than 2 times after the value of its cell.

    Please Login or Register  to view this content.
    One more thing:
    I changed this line:
    Please Login or Register  to view this content.
    To:
    Please Login or Register  to view this content.
    Is it possible when user click the last target row (without the strikethrough) of the ws then have a popup msgbox "The task now is complete. Please click Yes button" (only Yes option :-)) to force the wb run the last macro to send the email out to the original requester.
    Reason to do this is user may forget to send email out and then they will point a finger to me :-).
    Regards,
    tt3
    Last edited by tuongtu3; 06-08-2013 at 08:04 PM. Reason: clarification

  13. #13
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    HI,

    1. Clarification:
    Target is a Range object representing the cell which was doubleClicked
    xlRng is a Range object representing the cell where the first key e.g. "123456" was found in "PastDue.xlsm"

    2. Where did you put that line?
    Please Login or Register  to view this content.
    It would basically change Columns Q in the line where you double clicked

    3. When you say "last Target row" you mean the macro will have to check all other rows for font color or Strikethrough?
    Then you have to define the Range where the data than can potentially be copied by doubleclick, and yes it is possible.
    For this could you provide a sample workbook which looks like your original file, I mean including all headers/footers, the data itself can be just test data.

  14. #14
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi Tehnexus,
    Please take a look at sample in attached.

    Regards,
    tt3
    Attached Files Attached Files

  15. #15
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,

    try this:
    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi
    I have a problem to combine two target in the same code you're helping me. In the Post#1 I have three target and now I try to connect the below but it does not work. Can you take a look and help me out?

    Please Login or Register  to view this content.
    Regards,
    tt3

  17. #17
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Quote Originally Posted by tuongtu3 View Post
    I try to connect the below but it does not work.
    What exactly "does not work", you got an error? if yes in which line with what message? In which sub is this? what did you doubleclick?
    If no error but the macro does not do what you like it to be done please post the entire code.

  18. #18
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,
    When I combined two codes (your code @ target column J and my internet @ target column H), it worked well only after I double click any row at column H then it stop working. I have to restart my comp and it work one time then stop working again. Not sure what's wrong with this internet code. I also post another thread to see if my excel macro is wrong. Please take a look and thank you very much for your time and help.

    Regards,
    tt3

    http://www.excelforum.com/excel-prog...o-setting.html

  19. #19
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Without seeing any "internet code" I assume with "not working" you mean the doubleclick event is not triggered and I assume this is due to setting the events off, in

    Please Login or Register  to view this content.
    but then not setting them to true again

  20. #20
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,
    I removed this line and it work for now
    Please Login or Register  to view this content.
    I have a question regarding email. I want to sent email out when I do Double_Click at the last items in the wbThis, not at the last items in wbMstr. I tried several time but mail never being sent out.

    Regards,
    tt3

  21. #21
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,

    to send a mail check this: http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx
    The code in post #15 has a sub to send a mail if you clicked the last cell already prepared.

    If this does not solve your problem please post your code

  22. #22
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,
    I don't have any problem with the email code. My question is where should I put email code? If I put it right below a line of Send Email in your code then the email will be sent out, but it will not be sent out if I put exactly where indicated in your code.

    1. How to exit sub if there is blank or nothing after I autofilter?
    2. What is the best method to get email address to sent out via vba code? Currently I put all clients (1000+) name & email address, website, phone buss address in sheet3, Sheets("Sheet3").Range("A1").Formula = vlookup () then I get the info from Range("A1").email address; Range("B1").contact phone; Range("C1").bus. address;

    Regards,
    tt3

    Please Login or Register  to view this content.
    Last edited by tuongtu3; 06-13-2013 at 12:27 AM. Reason: additional questions

  23. #23
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    0. The fact that the email is sent when the code is in the bigger sub and not separated into another depends on how the mailing is coded.

    1. I didn't see any autofilter in your example file, do you autofilter a table or just a range of data?

    2. there are no vlookup formulas or matching tables in your example file, there are for sure faster ways to get those values, e.g. use the find function of the range object

  24. #24
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: Need help to Find the match then enter the value fr WB to WB after Double_Click

    Hi,
    Everything was ok then now the email stop sending out when I click at the last cell after I tried to clean up my code. I may deleted some line that stop sending out the email.
    I can send you my entire code in private message if this does not violate the forum rule (This is really simple code). Let me know.
    I'm trying to modify if column P larger than today date (after 2click at each cell, the value at target cell (offset 6) will be equal today date + 30
    I think my problem is from here:
    Please Login or Register  to view this content.

    Updated:
    I changed this
    Please Login or Register  to view this content.
    To:
    Please Login or Register  to view this content.
    But still want to see why I can not use your code

    Regards,
    tt3
    Last edited by tuongtu3; 06-14-2013 at 01:21 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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