+ Reply to Thread
Results 1 to 2 of 2

VBA Excel vlookup and then copy the result to clipboard

Hybrid View

  1. #1
    Registered User
    Join Date
    04-03-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    VBA Excel vlookup and then copy the result to clipboard

    Hi Guys and thanks in advance for any info shared,

    I have a person's name in cell D50 in Sheet 1 in excel and I want to reference this with a table in Sheet 2 to receive the mail of the person, in column D. I have about 100 names. I know this can be done with vlookup but then I also want to have the corresponding e-mail copied to the clipboard so I can paste it manually in outlook. I am trying to run this code but it gives error 13.

    Dim obj As New DataObject
    Dim txt As String

    'Put some text inside a string variable
    txt = Evaluate("=VLOOKUP(D50,Sheet3!A1:B100,2,0)")

    'Make object's text equal above string variable
    obj.SetText txt

    'Place DataObject's text into the Clipboard
    obj.PutInClipboard

    End Sub


    Any help will be much appreciated!

  2. #2
    Registered User
    Join Date
    04-03-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    Re: VBA Excel vlookup and then copy the result to clipboard

    Hi, the code is actually works, I just had to type manually the vlookup formula! Cheers!

+ 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. Excel charts won't cut or copy to clipboard
    By sean7690 in forum Excel General
    Replies: 4
    Last Post: 04-02-2015, 05:31 AM
  2. [SOLVED] Help with Userform textbox value, vlookup, copy to clipboard
    By etuckram in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 07-04-2012, 09:25 PM
  3. Copy to clipboard using IF in excel
    By uydarp in forum Excel General
    Replies: 5
    Last Post: 06-22-2009, 03:03 PM
  4. Copy Excel row to clipboard
    By patgenn123 in forum Excel General
    Replies: 0
    Last Post: 03-14-2009, 11:45 PM
  5. copy temp sum in bottom right of excel to clipboard
    By Job in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2005, 10:06 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