# VBA to replace values in specific column.



## arpirnat

I want the VBA to replace multiple values in a column, and only that column.  Currently when I run this it is replacing the values in all columns on the worksheet.



		Code:
__


Columns("H").Replace What:="CHOICE-UEXB IC*", Replacement:="CHOICE UEXB", _
        LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
        False, ReplaceFormat:=False


----------



## Ken Cowen

When I run it it only replaces values in column  H.
Can you provide the context for that line of code?
There has got to be something else going on as the following works fine for me.


Sub test()


Columns("H").Replace What:="CHOICE-UEXB IC*", Replacement:="CHOICE UEXB"


End Sub




Ken


----------



## rafcik

Ken Cowen said:


> When I run it it only replaces values in column  H.
> Can you provide the context for that line of code?
> There has got to be something else going on as the following works fine for me.
> 
> 
> Sub test()
> 
> 
> Columns("H").Replace What:="CHOICE-UEXB IC*", Replacement:="CHOICE UEXB"
> 
> 
> End Sub
> 
> 
> 
> 
> Ken


Hi Ken, 
Correct this piece of code seems to be working fine as well for me, replacing values only in the selected column.

Thanks!
Rafael.


----------

