Easy Excel Question

JayFromBoston

New Member
Joined
Nov 27, 2018
Messages
6
I want every "26" to be replaced with the value in cell i2. See image. How do I do that?
Screenprint18.jpg
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If you add another cell that can put the original number to replace it with, than you can do something like this:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim lastRow As Long
If Target.Address = "$E$2" Then
    lastRow = Cells(Rows.Count, "B").End(xlUp).Row
    Range("B2:B" & lastRow).Replace What:=Range("E1"), Replacement:=Range("E2"), LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
        Range("E1").Value = Range("E2").Value
End If
End Sub

Snag_155a8245.png
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,772
Members
449,095
Latest member
m_smith_solihull

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