+ Reply to Thread
Results 1 to 2 of 2

Copy paste cell from workbook to another under certain conditions

  1. #1
    Forum Contributor
    Join Date
    04-19-2009
    Location
    Toulouse, France
    MS-Off Ver
    Excel 2010
    Posts
    130

    Copy paste cell from workbook to another under certain conditions

    Hi all,

    has been a while since i have posted and as long since i have used excel. I have two workbooks (too large to post), for simplicity call the data workbook "Source" and the target workbook "Target". Each of them have tables with headers. In "Source" the headers are located in row 1 in "Target" row 4 (if relevant). Source data has been converted from pdf so is in csv. If A"" "Source" (header is Example) is numeric (i.e not text) and E"" "Source" does not equal "0, 000" I would like to copy the cell in the corresponding row from column D"" "SOURCE" that has the header NAME (the data in NAME begins in row 2) to "Target" column G with the header NAME (data for that column should begin in row 5). To reiterate copy if those conditions are met and leave if not. The number of rows is variable. Also I will be executing this daily so i dont want to overwrite previous days data in "Target". So probably need to start in empty cell of that column i.e following on from previous days data. Thanks in advance for your help. I hope this is clear, if you have any questions dont hesitate to ask. I have spent a considerable amount of time perusing the forums searching for solutions and whilst i have made some progress reacquainting myself with vba i am still getting errors all over the place. Thanks again. I forgot to add the relevant sheet names in Source it is "Table 1" in Target "Movements".

    Dan
    Last edited by Cicada; 10-01-2014 at 10:10 AM. Reason: missing info

  2. #2
    Forum Contributor
    Join Date
    04-19-2009
    Location
    Toulouse, France
    MS-Off Ver
    Excel 2010
    Posts
    130

    Re: Copy paste cell from workbook to another under certain conditions

    Hello,

    I have posted (see attached) very simple table to illustrate what I need. Sorry for my previous confusing explanation.

    For this example i have kept it to one workbook, once i see some code will hopefully be able to make it work with sheets in separate workbooks by changing the code a little. As you can see there is a table on sheet 1 and another on sheet 2. What i am trying to do is develop a code that will copy cells if two conditions are met. First condition is that Column A ("Class") <> 2 and that column E ("Mark") <> 0,00 for those rows where these conditions are met I want the student name to be copied to sheet 2 column A and for student mark to be copied in sheet 2 column C result. I hope this clarifies things I need to familiarise myself again with VBA, so hopefully i can figure out the rest if someone can give me a start. Thankyou in advance.

    Regards
    Dan
    Attached Files Attached Files

+ 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. [SOLVED] Macro to copy a specific cell and paste in another cell, for all sheets in workbook
    By lyoung1124 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2014, 10:15 AM
  2. How to search a cell value and copy & paste into another workbook
    By alfredsoh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-22-2013, 04:08 AM
  3. Macro to copy one cell from one workbook and paste it in another cell in onother book
    By Desmond_Mocumi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2013, 06:40 AM
  4. Copy range from one workbook, paste to next empty cell in another workbook
    By glock9mm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2013, 12:16 AM
  5. [SOLVED] Halp! Read cell for seperator, copy text, paste each segment to new workbook cell.
    By youngtusk87 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-07-2012, 07:38 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