Need Find ID No. and Replace the Address details of that current ID Number to Shorter Version

Leicester City Fox

Board Regular
Joined
Oct 7, 2016
Messages
91
Office Version
  1. 2019
Platform
  1. Windows
Need Find ID No.and Replace the Address details of that current ID Number to Shorter Version<o:p></o:p>
Hi There<o:p></o:p>
Can any body suggest any formula or a ways of looking updata of finding and matching unique IDNo.And replacing the address details below of that ID No.?. I am current usingFind and replace but it taking too long as I have thousands on entries and haveto do many years<o:p></o:p>
Source Data Below:<o:p></o:p>

A<o:p></o:p>

B<o:p></o:p>

C<o:p></o:p>

D<o:p></o:p>

E<o:p></o:p>

Years<o:p></o:p>

ID no.<o:p></o:p>

Name<o:p></o:p>

Address<o:p></o:p>

charged<o:p></o:p>

2016<o:p></o:p>

123<o:p></o:p>

Mr A<o:p></o:p>

1 Green Road Leicester LE1 123<o:p></o:p>

£1,457.90 <o:p></o:p>

2016<o:p></o:p>

456<o:p></o:p>

Mr B<o:p></o:p>

Blue Close Leicester LE2 123<o:p></o:p>

£456.56 <o:p></o:p>

2016<o:p></o:p>

789<o:p></o:p>

Miss C<o:p></o:p>

2 Yellow Lane Leicester LE3 123<o:p></o:p>

£123.32 <o:p></o:p>

2016<o:p></o:p>

98<o:p></o:p>

Mrs D<o:p></o:p>

3 Red Brick House Leicester LE4 123<o:p></o:p>

£1,234.67 <o:p></o:p>

2016<o:p></o:p>

234<o:p></o:p>

Ms E<o:p></o:p>

4 Orange Patch Leicester LE5 123<o:p></o:p>

£678.00 <o:p></o:p>

<tbody>
</tbody>
<o:p></o:p>
Find and Change all addresses that has the following ID No.sto new shorter version below:<o:p></o:p>
123<o:p></o:p>
1 Green Road <o:p></o:p>
789<o:p></o:p>
2 Yellow Lane <o:p></o:p>
98<o:p></o:p>
3 Red Brick House <o:p></o:p>
234<o:p></o:p>
4 Orange Patch<o:p></o:p>

<tbody>
</tbody>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Result that I am looking for is below:<o:p></o:p>

A<o:p></o:p>

B<o:p></o:p>

C<o:p></o:p>

D<o:p></o:p>

E<o:p></o:p>

Years<o:p></o:p>

ID no.<o:p></o:p>

Name<o:p></o:p>

Adress<o:p></o:p>

charged<o:p></o:p>

2016<o:p></o:p>

123<o:p></o:p>

Mr A<o:p></o:p>

1 Green Road <o:p></o:p>

£1,457.90 <o:p></o:p>

2016<o:p></o:p>

456<o:p></o:p>

Mr B<o:p></o:p>

Blue Close Leicester LE2 123<o:p></o:p>

£456.56 <o:p></o:p>

2016<o:p></o:p>

789<o:p></o:p>

Miss C<o:p></o:p>

2 Yellow Lane <o:p></o:p>

£123.32 <o:p></o:p>

2016<o:p></o:p>

98<o:p></o:p>

Mrs D<o:p></o:p>

3 Red Brick House <o:p></o:p>

£1,234.67 <o:p></o:p>

2016<o:p></o:p>

234<o:p></o:p>

Ms E<o:p></o:p>

4 Orange Patch<o:p></o:p>

£678.00 <o:p></o:p>

<tbody>
</tbody>
<o:p></o:p>
I am current using Find and Replacebut it taking too long as I have thousands on entries and have to do many yearsI don’t know if there a way of using a lookup or match / replace Formula are begreat for any ideas and suggestion that would h<o:p></o:p>
Thank you<o:p></o:p>
The Leicester City Fox <o:p></o:p>
<o:p></o:p>
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,849
Office Version
  1. 365
Platform
  1. Windows
Using an empty column place something like:

=IFERROR(VLOOKUP(B2,Sheet2!$A$1:$B$4,2,0),D2)

where Sheet2!$A$1:$B$4 houses your lookup table.

You can copy down and then copy and pastespecial over the original addresses
 
Upvote 0

Leicester City Fox

Board Regular
Joined
Oct 7, 2016
Messages
91
Office Version
  1. 2019
Platform
  1. Windows
Hi Steve<o:p></o:p>
Good Morning<o:p></o:p>
I just want thank you for the formula works a dream you’re astar J<o:p></o:p>
Thanks Again<o:p></o:p>
Leicester City Fox<o:p></o:p>
 
Upvote 0

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
Leicester City Fox,

Here is a macro solution for you to consider.

You can change the worksheet names in the macro.

Sample raw data worksheets:


Excel 2007
AB
1ID No.
21231 Green Road
37892 Yellow Lane
4983 Red Brick House
52344 Orange Patch
6
Find and Change



Excel 2007
ABCDE
1YearsID no.NameAddresscharged
22016123Mr A1 Green Road Leicester LE1 123£1,457.90
32016456Mr BBlue Close Leicester LE2 123£456.56
42016789Miss C2 Yellow Lane Leicester LE3 123£123.32
5201698Mrs D3 Red Brick House Leicester LE4 123£1,234.67
62016234Ms E4 Orange Patch Leicester LE5 123£678
7
Source Data


And, after the macro:


Excel 2007
ABCDE
1YearsID no.NameAddresscharged
22016123Mr A1 Green Road£1,457.90
32016456Mr BBlue Close Leicester LE2 123£456.56
42016789Miss C2 Yellow Lane£123.32
5201698Mrs D3 Red Brick House£1,234.67
62016234Ms E4 Orange Patch£678
7
Source Data


Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

1. Copy the below code
2. Open your NEW workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

Code:
Sub FindID_Replace()
' hiker95, 11/25/2016, ME977758
Dim wf As Worksheet, ws As Worksheet
Dim c As Range, id As Range
Application.ScreenUpdating = False
Set wf = Sheets("Find and Change")    '<-- you can change the sheet name here
Set ws = Sheets("Source Data")        '<-- you can change the sheet name here
With wf
  For Each c In .Range("A2", .Range("A" & Rows.Count).End(xlUp))
    Set id = ws.Columns(2).Find(c.Value, LookAt:=xlWhole)
    If Not id Is Nothing Then
      With ws.Cells(id.Row, 4)
        .Value = c.Offset(, 1).Value
        .Font.Bold = True
      End With
      ws.Cells(id.Row, 2).Font.Bold = True
    End If
  Next c
End With
With ws
  .Columns(4).AutoFit
  .Activate
End With
Application.ScreenUpdating = True
End Sub

Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm, and, answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.

Then run the FindID_Replace macro.
 
Upvote 0

Leicester City Fox

Board Regular
Joined
Oct 7, 2016
Messages
91
Office Version
  1. 2019
Platform
  1. Windows
Hi Hiker95<o:p></o:p>
Good Morning<o:p></o:p>
Thank you for that it’s a different solution to theproblem many thanks J<o:p></o:p>
Leicester City Fox<o:p></o:p>
 
Upvote 0

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
Leicester City Fox,

Thanks for the feedback.

You are very welcome. Glad I could help.

And, come back anytime.
 
Upvote 0

Forum statistics

Threads
1,190,783
Messages
5,982,900
Members
439,806
Latest member
ShakeShark1

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
Top