how do i automatically correct a word?

what I do is use a table of parameters in a separate sheet and I put in the column A the words that I want to evaluate when comparing it in the table of parameters I enter it in a variable and I apply ucase () to standardize to uppercase in both criteria To evaluate if the word is contained I use the word that is defined in the parameter table and in addition to using trim (), to remove the empty spaces this would be the code.

dim PalabraCorrecta as string
dim PalabraEvaluar as string
dim fila, row_yourbook as integer
FILA = 5
row_yourbook = 2
do while YourBook.sheets("YourSheetsname").range("L" & row_yourbook).value <> ""
    do while thisworkbooks.sheets("PARAMETROS").RANGE("A" & FILA).VALUE <> ""
    PalabraCorrecta = thisworkbooks.sheets("PARAMETROS").RANGE("A" & FILA).VALUE
    PalabraEvaluar = YourBook.sheets("YourSheetsname").range("L" & row_yourbook).value
        if instr(1,trim(ucase(PalabraCorrecta)),trim(ucase(PalabraEvaluar)), vbTextCompare) > 0 then
        YourBook.sheets("YourSheetsname").range("L" & row_yourbook).value = PalabraCorrecta
        goto out_parameter
        end if
    FILA = FILA  +1
    loop
out_parameter:
row_yourbook = row_yourbook +1
loop

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top