Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is it possible to change the normal excell icon on an excell file? | Excel Worksheet Functions | |||
auto locking of excell workbook (excell 2003) | Excel Discussion (Misc queries) | |||
How to open MS Excell 2007 Sheet in MS Excell 2000??? | New Users to Excel | |||
create a slides show with excell spreadsheets using excell | Charts and Charting in Excel | |||
how do you open an excell email attacment, if I dont have excell | Excel Discussion (Misc queries) |