![]() |
excel macro inconsistency
I recorded a macro which selects a column and then
replaces all instances of "-" with "". I cut and pasted the recorded code into a larger macro. If I run the macro it does not execute the replacement, but does not generate any errors. If I step through the macro via the debugger the replace executes properly. Anyone know what is going on? Some kind of timing issue? |
excel macro inconsistency
Pls. post the code.
KL "JM" wrote in message ... I recorded a macro which selects a column and then replaces all instances of "-" with "". I cut and pasted the recorded code into a larger macro. If I run the macro it does not execute the replacement, but does not generate any errors. If I step through the macro via the debugger the replace executes properly. Anyone know what is going on? Some kind of timing issue? |
excel macro inconsistency
Hi
see your other post -- Regards Frank Kabel Frankfurt, Germany "JM" schrieb im Newsbeitrag ... I recorded a macro which selects a column and then replaces all instances of "-" with "". I cut and pasted the recorded code into a larger macro. If I run the macro it does not execute the replacement, but does not generate any errors. If I step through the macro via the debugger the replace executes properly. Anyone know what is going on? Some kind of timing issue? |
excel macro inconsistency
Columns("B:B").Select
Selection.Replace What:="-", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False This code is in a procedure, and is called within the same module. If I step through the code it works fine. JM -----Original Message----- Pls. post the code. KL "JM" wrote in message ... I recorded a macro which selects a column and then replaces all instances of "-" with "". I cut and pasted the recorded code into a larger macro. If I run the macro it does not execute the replacement, but does not generate any errors. If I step through the macro via the debugger the replace executes properly. Anyone know what is going on? Some kind of timing issue? . |
excel macro inconsistency
Code posted in reply to KL
-----Original Message----- Hi see your other post -- Regards Frank Kabel Frankfurt, Germany "JM" schrieb im Newsbeitrag ... I recorded a macro which selects a column and then replaces all instances of "-" with "". I cut and pasted the recorded code into a larger macro. If I run the macro it does not execute the replacement, but does not generate any errors. If I step through the macro via the debugger the replace executes properly. Anyone know what is going on? Some kind of timing issue? . |
excel macro inconsistency
Hi
try: Activesheet.columns("B:B").Replace What:="-", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False -- Regards Frank Kabel Frankfurt, Germany "JM" schrieb im Newsbeitrag ... Columns("B:B").Select Selection.Replace What:="-", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False This code is in a procedure, and is called within the same module. If I step through the code it works fine. JM -----Original Message----- Pls. post the code. KL "JM" wrote in message ... I recorded a macro which selects a column and then replaces all instances of "-" with "". I cut and pasted the recorded code into a larger macro. If I run the macro it does not execute the replacement, but does not generate any errors. If I step through the macro via the debugger the replace executes properly. Anyone know what is going on? Some kind of timing issue? . |
excel macro inconsistency
I figured it out, actually. I was running a query and then
formatting the data, but the query was not finished before the formatting started. I set the backgroundquery condition on the refresh command to false, and now ti the timing is fine. Thanks though! -----Original Message----- Hi try: Activesheet.columns("B:B").Replace What:="-", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False -- Regards Frank Kabel Frankfurt, Germany "JM" schrieb im Newsbeitrag ... Columns("B:B").Select Selection.Replace What:="-", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False This code is in a procedure, and is called within the same module. If I step through the code it works fine. JM -----Original Message----- Pls. post the code. KL "JM" wrote in message ... I recorded a macro which selects a column and then replaces all instances of "-" with "". I cut and pasted the recorded code into a larger macro. If I run the macro it does not execute the replacement, but does not generate any errors. If I step through the macro via the debugger the replace executes properly. Anyone know what is going on? Some kind of timing issue? . . |
All times are GMT +1. The time now is 10:26 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com