Using .Replace
How can I find and replace for a certain range? I'd
rather not use Cells.Replace.... and search the entire sheet: Sub Worksheet_Activate() Set area = Sheets("Layout-Bulk (2)").Range("A7:BR53") For Each cell In area .Replace What:="##", Replacement:="=" Next cell End Sub Thx. Jason |
Using .Replace
Jason,
It is a bad idea to use variables that are used within the Object Model (area is one) Dim myArea As Range Set myArea = Sheets("Layout-Bulk (2)").Range("A7:BR53") myArea.Replace .... HTH, Bernie MS Excel MVP "Jason Morin" wrote in message ... How can I find and replace for a certain range? I'd rather not use Cells.Replace.... and search the entire sheet: Sub Worksheet_Activate() Set area = Sheets("Layout-Bulk (2)").Range("A7:BR53") For Each cell In area .Replace What:="##", Replacement:="=" Next cell End Sub Thx. Jason |
Using .Replace
Hi Bernie
"Area" is OK to use. It's not used in the object model. I believe you mean "Areas". -- Best Regards Leo Heuser Followup to newsgroup only please. "Bernie Deitrick" <deitbe @ consumer dot org skrev i en meddelelse ... Jason, It is a bad idea to use variables that are used within the Object Model (area is one) Dim myArea As Range Set myArea = Sheets("Layout-Bulk (2)").Range("A7:BR53") myArea.Replace .... HTH, Bernie MS Excel MVP |
All times are GMT +1. The time now is 03:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com