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? :confused:
Re: Copying adjacent cell to formula cell
vlookup function (in excel) read up on it :)
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!
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? :confused:
Copy them where? you're not explaining this right I think.
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? :)
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?
Re: Copying adjacent cell to formula cell
Zilch, zero, nada, nothin,......
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