+ Reply to Thread
Results 1 to 4 of 4

Copy and paste a cell into another cell according to its content

  1. #1
    Registered User
    Join Date
    06-20-2007
    Location
    London, UK
    Posts
    10

    Cool Copy and paste a cell into another cell according to its content

    Hi

    I need help with this.

    I need to copy contents of cells ( by rows) from one excel sheet to another. But the destination column of the cell will depend on the value of the cell being copied.

    Say the "recipient" sheet will have columns for products P1234EN, P1234ES, P1443EN, P1443FR etc and may be they are in columns H,I,J,K and in the next row a corresponding quantity

    The "donor" sheet will have a number of columns , each column predefined for one product as heading. I need to copy across from donor sheet to recipient sheet the quantity data from row by row placing each quantity under the correct product code column.
    I want to go down rows 1 to X until empty row is reached and look at value of B1 (which is P1234EN) move along to C1 and copy this number and paste it in the recipient sheets Column which matches B1. I will know in advance what the columns in the recipient sheet will be.

    Can this be done? is there a way to automate this?

    I have a similar VBA code which copies from one sheet to another row by row. But with that one I can specify in the code where each data will be copied to. Difference here is that where the data ends up is determined by the value of another cell.

    Thanks for any advice.

    Talāt

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Copy and paste a cell into another cell according to its content

    Hi Talat,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    06-20-2007
    Location
    London, UK
    Posts
    10

    Re: Copy and paste a cell into another cell according to its content

    Thanks for the response Robert.

    I have only just seen this. I was waiting to receive an email alert saying that there was a reply to my post, but for some reason I never received it.
    I will try your suggestion and come back to you. I am very grateful to you for taking the time to respond and make this suggestion.

    Talk later.

    Talāt

  4. #4
    Registered User
    Join Date
    06-20-2007
    Location
    London, UK
    Posts
    10

    Re: Copy and paste a cell into another cell according to its content

    Hi Robert and anyone else who is willing to help out,

    I tried Robert's suggestion above, but I guess due to my lack of VBA knowledge I did ot get very far. So I decided to have a different approach but this time I got stuck with the If/Elseif Statements. If anyone can sort me out with this, I think I am 90% there. I may get stuck again in the last part, but I will cry for help then.

    Here is my Code which I think it will work once I sort out the if statements ( and add many more of them)

    Thanks for your help and suggestions.

    Talat



    Please Login or Register  to view this content.

+ 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] [Solved] Conditional copy/paste cell content from one sheet to another
    By chng87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2014, 06:01 AM
  2. Copy cell content to clipboard to paste into a pdf
    By kevinm3u in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2014, 03:30 PM
  3. [SOLVED] Copy cell A1 and paste value into B1 if B1 has content, paste to B2...etc
    By mhopke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2012, 09:39 PM
  4. [SOLVED] Copy and paste row based on cell content
    By BDan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2006, 11:20 AM
  5. [SOLVED] How do I copy a formula/paste w/o losing the cell content?
    By CShannon in forum Excel General
    Replies: 6
    Last Post: 06-25-2005, 08:05 AM

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