Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Help would be greatly appreciated. Example is below.
I need a statement that would do the following: match a number within a column in sheet1 with several columns in sheet2 and the results would import the matching number's row from sheet2 to sheet 1. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
where A1 is the number you're trying to find in Sheet2!A1:C13, try:
=MIN(IF(Sheet2!A1:C13=A1,ROW(Sheet2!A1:C13))) array entered w/Cntrl+Shift+Enter. change ranges as needed (but cannot use entire columns, such as A:C). it should give you the first row in which that number appears. or for the relative row reference =MIN(IF(Sheet2!A1:C13=A1,ROW(Sheet2!A1:C13)-ROW(Sheet2!A1)+1)) (which makes no difference in this specific example since the data is in the first row of Sheet2) also array entered. "Help Needed!!!" wrote: Help would be greatly appreciated. Example is below. I need a statement that would do the following: match a number within a column in sheet1 with several columns in sheet2 and the results would import the matching number's row from sheet2 to sheet 1. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You gave me a better understanding. But here is what i am trying to do.
in sheet 1 column A row 1 through 20 there is numbers. i need to match the number in sheet 1 column A row 1 thru 20 with the same number in sheet 2 column A row 1 through 20. if the number match (if the statement is true) then copy/import the matching numbers row from sheet 2 to sheet 1. I hope that is more clear. Thank you for your help. "Help Needed!!!" wrote: Help would be greatly appreciated. Example is below. I need a statement that would do the following: match a number within a column in sheet1 with several columns in sheet2 and the results would import the matching number's row from sheet2 to sheet 1. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry for the misunderstanding. Try this macro (be sure to backup before):
Sub test() Dim rngCell As Range Dim rngDest As Range Dim rngSource As Range Dim rngMatch As Range Set rngDest = Worksheets("Sheet1").Range("A1:A20") Set rngSource = Worksheets("Sheet2").Range("A1:A20") On Error Resume Next For Each rngCell In rngDest.Cells Set rngMatch = rngSource.Find(What:=rngCell.Value, _ After:=rngSource.Cells(1, 1), LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False) If Not rngMatch Is Nothing Then _ rngMatch.EntireRow.Copy rngCell Next rngCell End Sub "Help Needed!!!" wrote: You gave me a better understanding. But here is what i am trying to do. in sheet 1 column A row 1 through 20 there is numbers. i need to match the number in sheet 1 column A row 1 thru 20 with the same number in sheet 2 column A row 1 through 20. if the number match (if the statement is true) then copy/import the matching numbers row from sheet 2 to sheet 1. I hope that is more clear. Thank you for your help. "Help Needed!!!" wrote: Help would be greatly appreciated. Example is below. I need a statement that would do the following: match a number within a column in sheet1 with several columns in sheet2 and the results would import the matching number's row from sheet2 to sheet 1. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF statement inside a SUMIF statement.... or alternative method | Excel Worksheet Functions | |||
Reconcile Bank statement & Credit card statement & accounting data | Excel Worksheet Functions | |||
Embedding an OR statement in an IF statement efficiently | Excel Discussion (Misc queries) | |||
If statement or lookup statement not sure | Excel Worksheet Functions | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions |