LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - Range.Replace within workbook over several sheets problem

Hi

I am stuck with the following problem:
I want to loop through some selected sheets within a workbook an
replace within an array formula, e
{=AVERAGE(IF(AE34:AE47<0;AE34:AE47))}, the cell reference x (eg AE47
with cell reference y (eg AE44).

For Each sht In ActiveWorkbook.Sheets

With Range(Cells(iRowRef, iColRef), Cells(iRowRef, iColEnd)).Replac
What:=iRowRef - 1, Replacement:=iStopAvg, LookAt:=xlPart
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False
ReplaceFormat:=False
End With

The replacement is performed in the 1st worksheet, but not in an
subsequent one, even though it does loop through correctly.

Also, the replacement function removes the array function brackets {
around the formula.

Any suggestions?

Thanks for your assistance, Mik

--
Message posted from http://www.ExcelForum.com

 
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
Can I replace data in all sheets in a workbook at the same time? LynetteB Excel Worksheet Functions 2 June 26th 09 09:01 PM
how do I do a global replace in all sheets in a workbook? knutknut Excel Worksheet Functions 3 June 26th 06 04:57 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
Find / Replace sheets vs workbook in VB Bony Pony Excel Worksheet Functions 0 December 8th 04 02:21 PM
Excel Macro Problem, Add-in need to work in every workbook & Error:9 Subscript out of range Burak[_2_] Excel Programming 1 October 31st 03 08:09 PM


All times are GMT +1. The time now is 09:41 PM.

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

About Us

"It's about Microsoft Excel"