Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Can I replace a ' at the beginning of a text cell using Replace Hilde Excel Discussion (Misc queries) 4 September 10th 07 06:22 PM
Replace dialog should put focus on "Find What" not "Replace With" Michael Williams Excel Discussion (Misc queries) 0 May 24th 06 12:45 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
How can I use replace(alt+H) for mutiple items needing replace Gery Excel Worksheet Functions 1 June 15th 05 05:51 PM


All times are GMT +1. The time now is 10:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"