Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
look up and return data in collumn Aaron Excel Discussion (Misc queries) 1 April 21st 07 11:28 PM
counting if data from one collumn is present in another collumn Amelia Excel Worksheet Functions 1 February 8th 07 10:05 PM
looking for a value in a collumn exceluser2 Excel Worksheet Functions 5 February 8th 06 11:53 PM
Looking up data within a collumn Demitre Excel Discussion (Misc queries) 3 December 21st 05 01:08 AM
How to find out how many rows do my collumn have? Leon[_3_] Excel Programming 4 December 22nd 03 09:38 AM


All times are GMT +1. The time now is 03:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"