Tom is right - an example would help.
This might get you started. to make this work
1. Have the values you want to check in a named range called “values” on the first sheet of your workbook
2. Select the cell within the “values” range with the value you want to look up
The macro will input in rows from row 1 on the second sheet of your workbook:
• The value of the selected cell in column A
• The value from column 1 of that cell's row (representing the x coordinate) in the second column
• The value from row 1 of that cell's row (representing the y coordinate) in the second column
Sub find_values()
Dim row_num
row_num = 1
For Each cell In Range("values").Cells
If cell.Value = ActiveCell.Value Then
Sheets(2).Columns(1).Rows(row_num) = cell.Value
Sheets(2).Columns(2).Rows(row_num) = Sheets(1).Rows(cell.Row).Columns(1).Value
Sheets(2).Columns(3).Rows(row_num) = Sheets(1).Columns(cell.Column).Rows(1).Value
row_num = 1 + row_num
End If
Next cell
End Sub
Bookmarks