ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Running auto correct on startup? (https://www.excelbanter.com/excel-discussion-misc-queries/57540-running-auto-correct-startup.html)

Mitch

Running auto correct on startup?
 
Hi,

I'm using excel 2003 and I'm looking for a way to manually or automatically
run auto correct on startup or after pasting. The thing is that I'm importing
large amounts of data and using text to columns to sort it out and
everythings fine, but the data comes from different places and does not
always match very well. Since it's important that for instance "St. Peters"
from one source and "Saint Peter's" from another source can automatically be
changed to the same "Saint Peter's" I'm looking for something with auto
correct here.

As of now I'm searching through the data for matches to change them manually
the one and the same.

The only thing it would take was if there was a way to initiate auto correct
manually on pasted data, cause then i could just take a day and add all the
changes to auto correct and then it would do the job for me.

Oh, i'm constantly overwriting old data with newer, pasting, so this is not
a one-time operation, cause if it was i could live with it but I really need
this.

Thanks
/Mitch

Dave Peterson

Running auto correct on startup?
 
Are you saying you've already added those corrections to your Autocorrect list?

If you haven't, I'd create another worksheet.

Column A would hold the old (mistyped words)
column B would hold the preferred words

Then have a macro that would loop through those cells to do mass changes.

Something like:

Option Explicit
Sub testme()

Dim ListWks As Worksheet
Dim WksToFix As Worksheet
Dim myCell As Range
Dim myRng As Range

Set ListWks = ThisWorkbook.Worksheets("sheet1")
Set WksToFix = ActiveSheet

With ListWks
Set myRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myRng.Cells
WksToFix.Cells.Replace what:=myCell.Value, _
replacement:=myCell.Offset(0, 1).Value, _
searchorder:=xlByRows, MatchCase:=xlYes
Next myCell
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Mitch wrote:

Hi,

I'm using excel 2003 and I'm looking for a way to manually or automatically
run auto correct on startup or after pasting. The thing is that I'm importing
large amounts of data and using text to columns to sort it out and
everythings fine, but the data comes from different places and does not
always match very well. Since it's important that for instance "St. Peters"
from one source and "Saint Peter's" from another source can automatically be
changed to the same "Saint Peter's" I'm looking for something with auto
correct here.

As of now I'm searching through the data for matches to change them manually
the one and the same.

The only thing it would take was if there was a way to initiate auto correct
manually on pasted data, cause then i could just take a day and add all the
changes to auto correct and then it would do the job for me.

Oh, i'm constantly overwriting old data with newer, pasting, so this is not
a one-time operation, cause if it was i could live with it but I really need
this.

Thanks
/Mitch


--

Dave Peterson


All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com