Replacing cell values

Solved/Closed
abhi - 26 May 2012 à 14:10
 abhi - 27 May 2012 à 07:05
Hi,

My requirement is to replace the cell values only for a given range. And my range is only the cell values in a given single column.
Below is the code I am using.

Sheets("Sheet1").Select
Range("A3", Range("A3").End(xlDown)).Select
Cells.Replace What:="smalldatetime", Replacement:="date", LookAt:=xlPart, _

But the issue I am facing is that the cell values are getting replaced in the columns B and C as well for the matching word, though columns B and C are not in the range specified.

Can anyone please guide me where I am going wrong.

Thanks in advance for help.

1 response

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
26 May 2012 à 17:38
This part is what you are doing wrong
"Cells."
you need "selection."
Thanks a lot for inputs. It's working now the way I want :)