Excel 2000 -Simplify macro

G

Gerry Cornell

This extract from a Macro I created in 2000 needs to be simplified as
there are 12 options.

Range("D8:D27").Select
Selection.Replace What:="NOV", Replacement:="DEC", LookAt:= _
xlPart, SearchOrder:=xlByColumns, MatchCase:=False
Range("D8:D27").Select
Selection.Replace What:="OCT", Replacement:="NOV", LookAt:= _
xlPart, SearchOrder:=xlByColumns, MatchCase:=False

I have also used the same approach to replace data in other
situations. How can this be achieved?

TIA


--

~~~~

Gerry

~~~~~~~~
Enquire, plan and execute.
Stourport, England
~~~~~~~~~~~~~~~~~
 
T

Tom Ogilvy

Monthname(13,True)

raises an error for me.

Also, doing i = 1 to 12 (or 11), would change everything to DEC wouldn't it.
Perhaps loop backwards, and put in some logic to handle the Dec to Jan
change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top