Replacing cell values

Solved/Closed
abhi - May 26, 2012 at 02:10 PM
 abhi - May 27, 2012 at 07:05 AM
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 January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 26, 2012 at 05:38 PM
This part is what you are doing wrong
"Cells."
you need "selection."
1
Thanks a lot for inputs. It's working now the way I want :)
0