Help with Formula to Find/Remove if same data in another cell
Closed
Kristen
-
Apr 11, 2015 at 11:02 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 20, 2015 at 11:40 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 20, 2015 at 11:40 AM
Related:
- Help with Formula to Find/Remove if same data in another cell
- Number to words in excel formula - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Date formula in excel dd/mm/yyyy - Guide
- Logitech formula vibration feedback wheel driver - Download - Drivers
- Tmobile data check - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Apr 20, 2015 at 11:40 AM
Apr 20, 2015 at 11:40 AM
Hi Kristen,
Try the following macro code to see if it yields the desired result:
How to implement and run a code:
- From Excel hit Alt + F11 to open the "Microsoft Visual Basic" window.
- Go to the top menu in the newly opened window > Insert > Module.
- Paste the code in the big white field.
- You can now close this window.
- Back at Excel, hit Alt + F8 to display the available macro's.
- Double-click the macro you wish to run.
NOTE: macro's cannot be reversed using the blue arrows. Always make sure you save your file before running a code, so you can reopen your file if something unforeseen happens or you want to go back to the situation before the code was run.
Best regards,
Trowa
Try the following macro code to see if it yields the desired result:
Sub RunMe() Dim lRow As Integer lRow = Range("B" & Rows.Count).End(xlUp).Row For Each cell In Range("B2:B" & lRow) cell.Replace What:=cell.Offset(0, 1), Replacement:=vbNullString, LookAt:=xlPart cell.Value = Trim(cell) Next cell End Sub
How to implement and run a code:
- From Excel hit Alt + F11 to open the "Microsoft Visual Basic" window.
- Go to the top menu in the newly opened window > Insert > Module.
- Paste the code in the big white field.
- You can now close this window.
- Back at Excel, hit Alt + F8 to display the available macro's.
- Double-click the macro you wish to run.
NOTE: macro's cannot be reversed using the blue arrows. Always make sure you save your file before running a code, so you can reopen your file if something unforeseen happens or you want to go back to the situation before the code was run.
Best regards,
Trowa