Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
While it may not be a problem here,
It is also worthy to note that substitute is case sensitive as shown from the immediate window: ? application.substitute("French Apple","apple","") French Apple -- Regards, Tom Ogilvy "Gary''s Student" wrote: Assuming that you SELECT a cell on the worksheet first: Sub fruitkiller() Dim r As Range Set r = Selection If r.Value 0 Then r.Offset(0, 1).Value = Application.Substitute(r.Offset(0, 1).Value, "apple", "") End If End Sub This only does the ActiveCell. You can put it in a loop to move down the entire column. -- Gary''s Student "FIRSTROUNDKO via OfficeKB.com" wrote: Hi! at the moment I am trying to write a code that looks at a list of cells and 1) evaluates an activecell in col a as being greater then zero and if so 2) if Cell b on the same row contains the text "apple" i.e English Apple then delete apple from cell Before -1 English apple 0 Welsh apple 1 Scottish apple 2 French apple After -1 English apple 0 Welsh 1 Scottish 2 French Thanks in advance -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200605/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
Name the ActiveCell | Excel Programming | |||
activecell | Excel Programming | |||
Activecell value | Excel Programming | |||
how to set activecell? | Excel Programming |