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: 13
Default VBA and Excell €“ really need you help

Hey!

Im kind of dummie in VBA. I usually just work with it to create macros.
Ive a important challenge now, that is: using an excel sheet with, average,
20000 cells, I need to replace a part of the cell content several times (i.e.
if my cell is 01-02-2006, the €œ02€ has to be replaced by €œMA€).
Im using the VB6 version and excel 2003.

i've tried this code:
sub replace()
worksheets("book1").select
Cells.Replace What:="-02-", Replacement:="-MA-", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,_
ReplaceFormat:=False
end sub()

the cells are formatted to date.

i've just noticed that the code does work but sometimes, i.e. if i want to
replace the content "-02-" to "-MA-", in all my attempts it just worked once.
But if i replace "2006" to "-MA-", it work all the time and the replace
cells are something like this: "01/02/-MA-", from the previous: "01-02-2006".
Even if i replace "0" to MA on "01-02-2006" the result will be:
"1/2/2-MA--MA-6"

BUt even after all this test and puting the cells on the original values i
try to do the "-02-" to "-MA-" replacement and nothing happens, nor even a
error
message.

Can you help me out here?..thanks in advance.
 
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
Is it possible to change the normal excell icon on an excell file? Romileyrunner1 Excel Worksheet Functions 7 September 8th 09 08:38 PM
auto locking of excell workbook (excell 2003) cheekymonkey Excel Discussion (Misc queries) 2 November 14th 08 11:50 PM
How to open MS Excell 2007 Sheet in MS Excell 2000??? Alek Luchnikov New Users to Excel 1 March 22nd 07 04:40 PM
create a slides show with excell spreadsheets using excell wantabepas Charts and Charting in Excel 0 June 16th 06 07:46 PM
how do you open an excell email attacment, if I dont have excell Gary Excel Discussion (Misc queries) 1 February 22nd 06 10:26 PM


All times are GMT +1. The time now is 02:07 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"