Find and Replace on a huge amount of records

Kai90

Board Regular
Joined
Jul 15, 2005
Messages
85
Hello all,

I am trying to find and replace certain characters that are in every field of table.

The catch is: The table has 600K records in it.
So when I use CTRL H (Find and Replace), it works great....but only for the first 10000 records or so. It won't do any after that.

Then I found a module:

Public Function fReplace(ByVal Expression As String, ByVal Find As String, ByVal Replace As String) As String
Dim strTmp As String, n As Integer

strTmp = Expression
n = InStr(strTmp, Find)

Do While n > 0
strTmp = Left(strTmp, n - 1) & Replace & _
Mid(strTmp, n + Len(Find))
n = InStr(n + Len(Replace), strTmp, Find, 1)
Loop

fReplace = strTmp

End Function

Source: http://www.access-programmers.co.uk/forums/showthread.php?t=142513

Then I call this function in my update query in the "update to" row.


While this works great, the problem I now face is, that the characters I try to get rid off, are a quotation marks (")

My update query looks like this:

fReplace([Field5],""","")

Of course this throws an "invalid String" error, because you cannot put a quotation mark in that spot.

Any ideas on how to replace quotation marks??? As said, this works great with all other characters....just not the quotation marks.


Thanks a lot,

Kai
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

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