UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Macro: Find And Replace, Office 2010    
 
   
jesmiki
post Feb 10 2012, 05:02 PM
Post #1

UtterAccess Enthusiast
Posts: 75



Greetings,

I am looking for a macro that will find and replace 14k records.

For example in sheet 1 I have 2 columns:

1. column "a" has the find value which can possibly be any where in sheet 2.

2. column "b" has the replace value

Can someone help me find a solution?

Best,

Carlo.
Go to the top of the page
 
+
MedicalServices
post Feb 10 2012, 05:44 PM
Post #2

UtterAccess Enthusiast
Posts: 55



The following will work assuming you are looking for 100 search values in column A sheet 1
CODE
Public Sub Find_Replace_Value()
Dim SheetToSearch As Worksheet
Dim Sheet1Value As Range
Set SheetToSearch = ActiveWorkbook.Worksheets(2)
Set Sheet1Value = ActiveWorkbook.Worksheets(1).Range("a1:a100")
For Each x In Sheet1Value.Cells
    SheetToSearch.Columns.Replace x, x.Offset(0, 1), xlByColumns
Next
End Sub


you can change the size of the Sheet1Value to suit your needs
Hope this helps!
Go to the top of the page
 
+
jesmiki
post Feb 10 2012, 05:50 PM
Post #3

UtterAccess Enthusiast
Posts: 75



Worked like a charm!!!!!
Go to the top of the page
 
+
jesmiki
post Feb 10 2012, 05:50 PM
Post #4

UtterAccess Enthusiast
Posts: 75



THANK YOU!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 08:34 PM

Tag cloud: