LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Arun
 
Posts: n/a
Default

yeah u can do it. by something like this

dim mSrcRwCtr, mTrgRwCtr as integer
mSrcRwCtr = 2 ' assuming you've field labels on row 1
mTrgRwCtr = 2
while Sheets("Sheet1").range("A" &mSrcRwCtr).value < "" ' assuming the date
value is in col A
if datediff("yyyy",Sheets("Sheet1").range("A" &mSrcRwCtr).value,today) then
Sheets("Sheet1").range("A" &mSrcRwCtr).select.entirerow
selection.cut
sheets("Sheet2").range("A"&mTrgRwCtr).select
ActiveSheet.Paste
mTrgRwCtr = mTrgRwCtr + 1
endif
mSrcRwCtr = mSrcRwCt + 1
wend

This is not a verified code, pl. check and have backup before trying this :)

"Greg B..." wrote:

Hi all

I am wondering if there is a code that i can run automatically, I have to
have my database no older than 2 years. What i would like is for a macro or
something to search the entire a column find the dates older than 2 year and
move then to another sheet.

Thanks in advance

Greg



 
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
Problems copying street addresses and dates C. Dales Excel Discussion (Misc queries) 4 February 11th 05 01:43 PM
Any way toturn off the "Auto Fill Options" pop-up after copying ce utkwh Excel Discussion (Misc queries) 2 January 20th 05 11:34 PM
excel links update not working in auto, calculations in auto Mikey Boy Excel Worksheet Functions 0 December 7th 04 11:53 PM
copying text into a macro pagelocator Excel Worksheet Functions 1 November 24th 04 08:52 AM
Why can't my macro use Auto Filter when I told the Sheet Protecti. KC Rippstein Excel Worksheet Functions 1 October 28th 04 06:13 PM


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