+ Reply to Thread
Results 1 to 5 of 5

Copy contents of a cell dependent on contents of another

  1. #1
    Registered User
    Join Date
    03-11-2011
    Location
    Longmont, CO
    MS-Off Ver
    Excel 2007
    Posts
    3

    Copy contents of a cell dependent on contents of another

    I haven't done anything advanced in Excel and I found that I have no idea to do what I'm looking for. Basically, I am importing a .txt file that is a listing of directories in Sharepoint. Column A of the first row starts with Directory blah blah (and a bunch of stuff spread over 5 columns), but all I really care about is what is in column E for each row that starts with Directory. There are then a bunch of rows that start with dates (numbers) in Column A listing all of the files in the directory listed in the row above it. Then there is another row starting with Directory, then subsequent rows starting with dates again.

    What I would like to do is have Excel go down Column A and if it see "Directory" I would like it to copy the contents of cell E of that same row. When it sees a date (number) I'd like it to paste the contents it copied into column F of that row. Repeating the copy and paste. So it will paste the same thing each time until it comes to a row that begins with "Directory". I should point out that there are empty rows between the rows that begin with "Directory" and thoses that begins with dates, so I'm guessing the function will just skip over these rows.

    Thanks for your help!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Copy contents of a cell dependent on contents of another

    Hi emerges and welcome to the forum,

    We need a short example of your file to deal with this question. Click on the "Go Advanced" below the message area and then on the Paper Clip Icon to upload an attached sample file. This will be your best chance of getting a good answer.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-11-2011
    Location
    Longmont, CO
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Copy contents of a cell dependent on contents of another

    Here is an example files (attached).

    I have been messing around with nesting IF and CELL functions, but haven't yet figured out how to have it keep pasting the sames contents until it sees Directory again. Thanks!
    Attached Files Attached Files

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Copy contents of a cell dependent on contents of another

    Hi emerges,
    I have your sample but am a little confused on what dates you want to copy and where.
    Could you do the first one by hand and background it so I can see your method?
    Do you want the dates or numbers or filenames in column F? Repeat column E?

    One more sample with expected and we can do it.

  5. #5
    Registered User
    Join Date
    03-11-2011
    Location
    Longmont, CO
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Copy contents of a cell dependent on contents of another

    I highlighted the cells that I would like to copy into Column F. Every time a row appears with Directory, the contents of cell E in that row are copied and then pasted in the rows below that start with a date. Does that make sense?
    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)

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