Quick Question

Gamermatt

Board Regular
Joined
May 14, 2009
Messages
186
Excel Workbook
ABCDE
12821351-21821351
23821350-CF2821351
34CFR03N3503821350-CF
45CFR05DM4CFR03N350
56CFR06DC5CFR05DM
67CFR08ML6CFR06DC
78CFR94AI7CFR08ML
89DF95ME-28CFR94AI
911F00FFBC9DF95ME
Sheet1



I need to go through the numbers in column A, find that number in column D, and replace the corresponding cell in column E with the corresponding one from column B
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
If there is no match, I presume you wish to preserve values in E column with their present value.

If that is the case you need to insert a column by highlighting Column E and inserting a column.

Then this formula in cell E1 and fill down.

=IFERROR(INDEX(B:B,MATCH(D1,A$1:A$9,0)),F1)

If you don't wish to preserve what is in column E, this formula in Cell E1 and fill down, no need to insert column.

=IFERROR(INDEX(B:B,MATCH(D1,A$1:A$9,0)),"No Match")
 
Upvote 0
Hi

I think this VBA solution will do what you want, it can be used under a command button or ss event.


Code:
Dim FindString As String
Dim Rng As Range
Dim fcomp
For Each fcomp In Range("a1:a9") ' range of Source Comparison

    FindString = fcomp
   
        
        With Sheets("Sheet1").Range("d1:d9") 'range of cells to search
            Set Rng = .Find(What:=FindString, _
                            After:=.Cells(1), _
                            LookIn:=xlValues, _
                            LookAt:=xlWhole, _
                            SearchOrder:=xlByRows, _
                            SearchDirection:=xlPrevious, _
                            MatchCase:=False)
            
            If Rng Is Nothing Then
                
                
                
            Else
            
               Rng.Offset(0, 1).Value = fcomp.Offset(0, 1)
                
            End If
        
        End With
             
  Next fcomp


regards

Saltkev
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top