+ Reply to Thread
Results 1 to 2 of 2

Find, Copy, and Paste

  1. #1
    Registered User
    Join Date
    03-13-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    59

    Find, Copy, and Paste

    Hi, I am new to VBA and am trying to put together some code that will do the following:

    Assuming I have the workbook "Results.xls" open (files are attached to thread):

    (1) Search Column A on the worksheet "sampleData" in the closed workbook (testData.xls) for the string value "STS".

    (2) When it finds the match, select Column C and copy the respective cell value

    (3) Paste that copied data in Column D on the active worksheet "Summary" (within the workbook "Results.xls") in the respective row (from Column A) where it says "STS".

    I have attached all the sample files I'd like to use to help illustrate my task

    I understand this is pretty similar to a V-Lookup, but I would like to learn the VBA procedure to do this.

    Thank you for any support provided.
    Attached Files Attached Files
    Last edited by NSTurk725; 11-19-2009 at 01:45 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Find, Copy, and Paste

    if the testdata.xls is in closed workbook you have to use the path of this file.

    you have to use something like this in the summary sheet summary in file results.xls

    =VLOOKUP(A4,'C:\unzipped\nsturk725\[TestDATA.xls]sampleData'!$A$1:$C$17,3,FALSE)

    in my computer the file testdata.xls is saved in the path
    C:\unzipped\nsturk725\
    you change this path to your path
    remember the single apostrophe in the beginning and again at the end of the sheet name(sampledata) is required. and also exclamation mark(!).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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