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: 12
Default Use VBA to replace 2002 by 2004 in Date

I work frequently with spreadsheets that are created through an export
from a particular application.These sheets have dates in them, that
use a Customformat d"-"m"-"yyy. Although the cells are recognised as
dates, I'm more than happy to change this to a standard date format
should that be necessary.

The problem is, the outside application works with dates, that based
on when they were first created default to:

31-12-2000
31-12-2001
31-12-2002
31-12-2003

For the purpose of my job, I have to change all of these to:

31-12-2004

When I do this without VBA it works perfectly. Recording a macro gives
the following result

Cells.Replace What:="31-12-????", Replacement:="31-12-2004", _
LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False

Entering this code in my VBA project, or even simply running this one
line of code does absolutely nothing however.

Anyone has an idea how to achieve this?

Leo Elbertse
 
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
Excel 2002: Why Find and Replace not working? Mr. Low Excel Discussion (Misc queries) 6 January 6th 09 03:37 PM
I can't format 01/19/2004 to read January 19, 2004, please help!! paulonline66 Excel Discussion (Misc queries) 5 June 17th 05 04:54 AM
Opening a Excel 2004 file in Excel 2002 jbaldwin1984 Excel Discussion (Misc queries) 2 March 3rd 05 11:15 PM
Save Excel 2002 to be read by MacIntosh Excel 2004? cagedbirdflies New Users to Excel 4 March 1st 05 08:55 AM
Send Excel 2002 spreadsheet to MacIntosh Excel 2004 cagedbirdflies Excel Discussion (Misc queries) 0 February 21st 05 08:13 PM


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