Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can this be done?


Im trying to automatically move a row to a new worksheet and out of the
current worksheet once the last column in that row reaches "today's"
date. Can this be done?


--
Naesgn
------------------------------------------------------------------------
Naesgn's Profile: http://www.excelforum.com/member.php...o&userid=35773
View this thread: http://www.excelforum.com/showthread...hreadid=555422

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Can this be done?

Try the following code:
define in module:

Private ExlApp As ExlClass

At the beginning, for example in auto_open sub
should be:

Set ExlApp=new ExlClass

Then insert in you VBA project new class, name it ExlClass.
Class code is the following. Correct it, if needed.

Private Sub Class_Initialize()
Set Exl = ThisWorkbook.Application
End Sub

Private Sub Exl_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.index = 1 Then 'replace with your index
If Target.Column = 10 And _
Cells(Target.row, Target.Column).Value = Date Then
Target.EntireRow.Select
Selection.Cut
ActiveSheet.Paste _
Destination:=Worksheets("Sheet2").Range("A1:A1") 'change range
Target.Select
Application.CutCopyMode = False
End If
End If
End Sub

Regards, Irina


"Naesgn" wrote:


Im trying to automatically move a row to a new worksheet and out of the
current worksheet once the last column in that row reaches "today's"
date. Can this be done?


--
Naesgn
------------------------------------------------------------------------
Naesgn's Profile: http://www.excelforum.com/member.php...o&userid=35773
View this thread: http://www.excelforum.com/showthread...hreadid=555422


Reply
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



All times are GMT +1. The time now is 04:16 AM.

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"