Replacing cell values

[Solved/Closed]
Report
-
 abhi -
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 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
This part is what you are doing wrong
"Cells."
you need "selection."
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Thanks a lot for inputs. It's working now the way I want :)