Find value in One Column and Populate Different value in Another column

msvoboda27

New Member
Joined
Feb 9, 2018
Messages
30
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
[TABLE="class: outer_border, width: 250, align: left"]
<tbody>[TR]
[TD]x[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Col 1 Value[/TD]
[TD]Col 2[/TD]
[TD]Find and replace the value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]FE7478PDF[/TD]
[TD]4[/TD]
[TD]if cell A2 FE7478PDF replace with value 700[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]FE7477PD[/TD]
[TD]4[/TD]
[TD][TABLE="class: outer_border, width: 250, align: left"]
<tbody>[TR]
[TD]if cell A3 FE7477PDF replace with value 710[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]FE744PDF[/TD]
[TD]4[/TD]
[TD]if cell A4 FE744PDF replace with value 915[/TD]
[/TR]
</tbody>[/TABLE]













I am trying to do a search and replace with one value and populate in a different cell. I also like to make this a macro if possible.
Thank you.
Michael
Unsure how to attach excel doc
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi, try this:

Code:
Sub loop_through_all_worksheets()


Dim ws As Worksheet
Dim idcount As Long


Set ws = ActiveSheet


    For i = 2 To ws.Columns(1).Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    
    Select Case Cells(i, 1).Value
        Case "FE7478PDF"
        Cells(i, 3).Value = "700"
        Case "FE7477PD"
        Cells(i, 3).Value = "710"
        Case "FE744PDF"
        Cells(i, 3).Value = "915"
    End Select
    Next i


End Sub
 
Last edited:
Upvote 0
Hi
I like to do a search and replace in Excel formula but the replaced cell in a adjacent cell.
Col A. Col B
567899. Value 4

If cell contents 567899 then overwrite contents from value 4 to new value, say 700.
Does that help, thanks for response
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

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