If cell contains partial string, then change cell value

user3900032

I have a list of hundreds of companies in a column. There are repeat companies that were inputted differently. (i.e. "Nike" vs "Nike Inc")

I am trying to program a macro in excel to loop through the column to search for "Nike" and if found it will replace what is in that cell to a consistent company name (i.e. "Nike, Inc.") The goal would be to have the macro search for many companies.

I appreciate any help!

Gary's Student

Here is an example for Nike and Ford

Sub Company()
    ary = Array("Nike", "Ford")
    Dim v As String, i As Long, j As Long
    For i = LBound(ary) To UBound(ary)
        v = ary(i)
        For j = 1 To Cells(Rows.Count, "A").End(xlUp).Row
            If InStr(1, Cells(j, "A"), v) > 0 Then
                Cells(j, "A") = v
            End If
        Next j
    Next i
End Sub

Expand ary() as required.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

WPF DataGrid change Cell background if the cell contains a specific value

From Dev

Change Value of Excel Cell when another cell contains specific character

From Dev

Jquery change table cell value if other cell contains word

From Dev

Contains a string in a cell

From Dev

insert cell next to a cell that contains a certain value

From Dev

Hide rows in Excel if a cell contains a certain string value

From Dev

Write rows to a CSV file if a cell contains a particular string value

From Dev

Change Cell Value if There is Overflow

From Dev

Cell value change with Month

From Dev

Change value of cell in Javascript

From Dev

Change value in a cell based on value in another cell

From Java

Check if list cell contains value

From Dev

If cell contains value then 'Column header'

From Dev

String that changes with cell value?

From Dev

Set a string to a value in a cell?

From Dev

Change colour of a cell based on the value in the cell and text in another cell

From Dev

Change the formatting of a cell depending on the value of that cell and another cell

From Dev

Partial cell(or string) match in excel macro

From Dev

Change raster cell values to NA if cell contains a point

From Dev

How to change color of a cell if the previous cell contains the hex color name?

From Dev

Change value of one cell based on partial contents of another plus Fuzzy Lookup video?

From Dev

Change DataGridView Cell Value Programmatically

From Dev

change cell in datagridview to empty value

From Dev

VBA Change Cell Value On Insert

From Dev

Change the value in a cell in a datagrid (binding)

From Dev

Change Formula =Hyperlink Cell Value

From Dev

Change datagriview cell value on CellValidating

From Dev

change cell value on button click

From Dev

how to set value in 2 cell if other cell contains 'something'

Related Related

  1. 1

    WPF DataGrid change Cell background if the cell contains a specific value

  2. 2

    Change Value of Excel Cell when another cell contains specific character

  3. 3

    Jquery change table cell value if other cell contains word

  4. 4

    Contains a string in a cell

  5. 5

    insert cell next to a cell that contains a certain value

  6. 6

    Hide rows in Excel if a cell contains a certain string value

  7. 7

    Write rows to a CSV file if a cell contains a particular string value

  8. 8

    Change Cell Value if There is Overflow

  9. 9

    Cell value change with Month

  10. 10

    Change value of cell in Javascript

  11. 11

    Change value in a cell based on value in another cell

  12. 12

    Check if list cell contains value

  13. 13

    If cell contains value then 'Column header'

  14. 14

    String that changes with cell value?

  15. 15

    Set a string to a value in a cell?

  16. 16

    Change colour of a cell based on the value in the cell and text in another cell

  17. 17

    Change the formatting of a cell depending on the value of that cell and another cell

  18. 18

    Partial cell(or string) match in excel macro

  19. 19

    Change raster cell values to NA if cell contains a point

  20. 20

    How to change color of a cell if the previous cell contains the hex color name?

  21. 21

    Change value of one cell based on partial contents of another plus Fuzzy Lookup video?

  22. 22

    Change DataGridView Cell Value Programmatically

  23. 23

    change cell in datagridview to empty value

  24. 24

    VBA Change Cell Value On Insert

  25. 25

    Change the value in a cell in a datagrid (binding)

  26. 26

    Change Formula =Hyperlink Cell Value

  27. 27

    Change datagriview cell value on CellValidating

  28. 28

    change cell value on button click

  29. 29

    how to set value in 2 cell if other cell contains 'something'

HotTag

Archive