Find a value in the collumn and then in that row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to find a cell value in the column in the sheet "FEDEX" that maches
entered value on the sheet "Calculate" and then I need to find a cell value
in that row in the column number that entered on sheet "Calculate". I need to
get last value in the sheet "Calculate".

Thank you for any hint!

Sheets("FEDEX").Range("A1:A975").Select
For Each Cell In Selection
x = Cells(Rows.Count, "a").End(xlUp).Row + 1
If Cell.Value = Sheets("Calculate").Range("F6").Value Then
ell.EntireRow.Select
For Each Cell1 In Selection
x = Cells(Column.Count, "a").End(xlLeft).Column + 1
If Cell1.Value = Sheets("Calculate").Range("E8").Value Then
Cell1.Value.Select
Next Cell1
Next Cell
End Sub
 
Does it have to be a programming solution?

Try:

=VLOOKUP(F6,FEDEX!A:Z,E8,FALSE)

You can use that in programming, too:

Dim vResult As Variant
Dim vWhat As Variant
Dim rRange As Range
Dim nCol As Long
With Sheets("Calculate")
vWhat = .Range("F6").Value
nCol = .Range("E8").Value
End With
Set rRange = Sheets("FEDEX").Range("A:Z")
vResult = Application.VLookup(vWhat, rRange, nCol, False)
Sheets("Calculate").Range("A1").Value = vResult
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top