Change the cell value only when a specific word is used

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Change the cell value only when a specific word is used

Post by ABabeNChrist »

Using code how can I change the value of a range of cells only if the cell value is “ green beans” and change it with Pinto beans.

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change the cell value only when a specific word is used

Post by HansV »

Code: Select all

Range("...").Replace What:="green beans", Replacement:="Pinto beans", LookAt:=xlWhole, MatchCase:=False
Best wishes,
Hans