Forum Discussion
brianrichard1120
May 04, 2021Copper Contributor
PLEASE HELP ENGINEERS
My code has worked for a few months and all of the sudden stopped working. My macro now does find and replace for the whole used range for my data. Here is the code: Sub CleanAC() Dim CharacterA...
JMB17
May 04, 2021Bronze Contributor
The more obvious difference, to me, is that Hans is not selecting the range. Your issue may be merged cells that are causing the selected range to expand beyond what you are expecting.
If you tested Hans's suggestion and it did not work, then perhaps you could upload a sample workbook with sensitive information removed? But, if you've not tried it yet, you should test his suggestion first.
If you tested Hans's suggestion and it did not work, then perhaps you could upload a sample workbook with sensitive information removed? But, if you've not tried it yet, you should test his suggestion first.
brianrichard1120
May 04, 2021Copper Contributor
Thank you for your response and pointing out that difference. I just attempted Hans solution and was met with the same problem unfortunately. My data varies in size but I am doing testing on a simple data set. I will post once I figure out how.
- brianrichard1120May 04, 2021Copper Contributor
brianrichard1120 I figured out how to post this JMB17 HansVogelaar and anyone willing to help.
- brianrichard1120May 04, 2021Copper ContributorLooking at this I understand my find and replace was only supposed to work on column L. You can change it to one of the first few columns there to work. But either way the error is still evident.
- JMB17May 04, 2021Bronze ContributorIt does not appear that the sample data contains any of the characters the macro is looking for?
I added some of the characters to be replaced to the data in columns A-E and added some data containing the characters to be replaced in column L. It does not appear that I'm able to replicate the problem - the macro found and replaced the specified characters in Column L without bothering any of the other data.
By chance, do you have any other vba code that may be interfering, such as a worksheet_change event handler (or some other event handler) that may be getting triggered by the find/replace action?