Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old February 17th 06, 08:58 AM posted to microsoft.public.excel.newusers
/Jan
 
Posts: n/a
Default Excel Macro does not Replace text in formulas for several workshee

Dear all, having tried to REPLACE "=" with "&" (to inactivate and activate an
add-in formula) in two different worksheets of the same workbook, the
"replace function" (see below macro) only works in the first (active)
worksheet. Suggestions?:

Sub Macro1()
Columns("B:E").Select
Selection.Replace What:="=INF", Replacement:="&INF", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Sheets("Sheet 2").Select
Application.Goto Reference:="Area2"
Selection.Replace What:="&INF", Replacement:="=INF", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Sheets("Sheet 1").Select
MsgBox ("Ready")
End Sub

It might be that "activating" the formula (chaning to "=") demands some
processing time, and a "wait" command is needed. However it seems my macro is
not even moving to sheet 2.

Kind regards /Jan

  #2   Report Post  
Old February 17th 06, 01:31 PM posted to microsoft.public.excel.newusers
Pete_UK
 
Posts: n/a
Default Excel Macro does not Replace text in formulas for several workshee

Have you tried single-stepping through the macro to discover what is
happening? You seem uncertain as to whether it reaches the line:

Sheets("Sheet 2").Select

Hope this helps.

Pete

  #3   Report Post  
Old February 17th 06, 02:57 PM posted to microsoft.public.excel.newusers
/Jan
 
Posts: n/a
Default Excel Macro does not Replace text in formulas for several work

Yes thanks, It reaches the second sheet. It seems more like the replace
function is not working properly when i try to shift from "=function(a,b,c)"
to "&function(a,b,c)", the "&" only to stop calculation of an add-in
function.
But if I instead try with replacing "=function(a,b,c)" by "=ffffff(a,b,c)",
sort of keeping a formula intact starting with "=", the replace function seem
to work better
Rgds /Jan

"Pete_UK" wrote:

Have you tried single-stepping through the macro to discover what is
happening? You seem uncertain as to whether it reaches the line:

Sheets("Sheet 2").Select

Hope this helps.

Pete




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
Excel keeps converting text to date format John T via OfficeKB.com Excel Discussion (Misc queries) 4 September 12th 05 06:48 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Excel - Find & Replace text in a string bklim Excel Worksheet Functions 1 June 14th 05 06:42 AM
Replace Number with Text using Macro Carter68 Excel Discussion (Misc queries) 3 April 19th 05 08:57 PM
Macro to delete and replace a text box Dave Excel Discussion (Misc queries) 0 February 24th 05 05:17 PM


All times are GMT +1. The time now is 06:04 AM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017