Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|