Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a value in the collumn and then in that row
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a value in the collumn and then in that row
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 In article , OxanaB wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a value in the collumn and then in that row
Thank you very much.
It worked and I used VLOOKUP. "JE McGimpsey" wrote: 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 In article , OxanaB wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
look up and return data in collumn | Excel Discussion (Misc queries) | |||
counting if data from one collumn is present in another collumn | Excel Worksheet Functions | |||
looking for a value in a collumn | Excel Worksheet Functions | |||
Looking up data within a collumn | Excel Discussion (Misc queries) | |||
How to find out how many rows do my collumn have? | Excel Programming |