Results 1 to 8 of 8

Thread: Copying adjacent cell to formula cell

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    69

    Copying adjacent cell to formula cell

    Hi,

    I have a seach criteria in one sheet, that looks at thousands of cells in another sheet.

    Formula =IF(COUNTIF(Sheet1!$C$2:$N$6200,E15),"Found","Not Found")

    Depending on the outcome of the formula, I would like to copy all of those cells ADJACENT to the cell containing the formula whos outcome is 'Found'


    Anyone get what I mean?
    Im here until I get good at this,.....the more help I get, the less silly questions you'll get! Thanks

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Copying adjacent cell to formula cell

    vlookup function (in excel) read up on it

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    69

    Smile Re: Copying adjacent cell to formula cell

    Quote Originally Posted by Ecniv
    vlookup function (in excel) read up on it
    Thats not what I am looking for. I want a Macro!
    Im here until I get good at this,.....the more help I get, the less silly questions you'll get! Thanks

  4. #4
    Addicted Member
    Join Date
    Jan 2005
    Posts
    138

    Re: Copying adjacent cell to formula cell

    Quote Originally Posted by Firestart
    I would like to copy all of those cells ADJACENT to the cell containing the formula whos outcome is 'Found'

    Anyone get what I mean?
    Copy them where? you're not explaining this right I think.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    69

    Re: Copying adjacent cell to formula cell

    Copy them elsewhere on the worksheet.

    Heres how it goes. I have a sheet (1) filled with loads of alpha numberic combinations. On another sheet (2), I have combinations that I was to find in sheet 1.

    At present, on sheet 2 I have the formula
    =IF(COUNTIF(Sheet1!$C$2:$N$6200,E5),"Found","Not Found")
    which is in a box next to the alphanumerics on sheet2.

    I actually want to highlight the alphanumeric on sheet1 and two other cells to the left of that alphanumeric figure.

    Any ideas?
    Im here until I get good at this,.....the more help I get, the less silly questions you'll get! Thanks

  6. #6
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Copying adjacent cell to formula cell

    I just pointed that function out as it is part of Excel and works v quickly. Compared to parsing via code.

    If you want to use code, then you'll need to loop through a range to match the first sheet, then copy the contents of adjacent cells to the other sheet, then move on the next row and begin the check again.

    What code do you have at the moment?

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    69

    Re: Copying adjacent cell to formula cell

    Zilch, zero, nada, nothin,......
    Im here until I get good at this,.....the more help I get, the less silly questions you'll get! Thanks

  8. #8
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Copying adjacent cell to formula cell

    So how do you want the people on the forum to help you if you have no code?

    Can you code a loop to go through:
    1) the selected range
    2) the cells to be checked against (main list of data)
    ?

    If you can code a loop to return the values in the search list (or was it just one row?), then use a similar loop on the main list to do the comparison (perhaps holding the search value in a string?). You should then have enough code to get the cells of the matching line and put them into the search forms rows...

    Try doing some code and posting up what doesn't work.

    You may want to lookup:
    .range
    .cells
    .sheets - variable of worksheet
    .workbooks - variable of workbook
    if statement
    .value or .formular1c1
    .copy

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width