Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default HELP !! Macros to autoexecute on open

Hello I have a task list that are scheduled on different days. I need help
for a code which will short list task due for the current date and/or not
completed from previous days.

My data are as follows
A B C D
Job No Employee Date_due Status
2501 John 03/16/07
2505 Trish 03/23/07 OK
2518 Paul 04/03/07

Upon opening the workbook It would be great if Job 2501 and 2518 could be
shortlisted say on sheet2, whereas sheet1 would contain the above list.

Anyone can help

Thank you your usual coorperation
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default HELP !! Macros to autoexecute on open

Use the code below. I did it as a regular macro (not worksheet_open) to make
it easier to debug.

Sub checkstatus()

'get last row of column a
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
'get range of sttatus column d
Set RangeColD = Range(Cells(2, 4), Cells(LastRow, 4))

RowCount = 1
For Each cell In RangeColD

If cell.Value < "OK" Then

If cell.Offset(Rowoffset:=0, columnoffset:=-1) < Now() Then

cell.EntireRow.Copy _
Destination:=Sheets("sheet2").Cells(RowCount, 1)

RowCount = RowCount + 1
End If


End If

Next cell

End Sub


"Wins07" wrote:

Hello I have a task list that are scheduled on different days. I need help
for a code which will short list task due for the current date and/or not
completed from previous days.

My data are as follows
A B C D
Job No Employee Date_due Status
2501 John 03/16/07
2505 Trish 03/23/07 OK
2518 Paul 04/03/07

Upon opening the workbook It would be great if Job 2501 and 2518 could be
shortlisted say on sheet2, whereas sheet1 would contain the above list.

Anyone can help

Thank you your usual coorperation

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default HELP !! Macros to autoexecute on open

Thanks this will definitely help.


"Joel" wrote:

Use the code below. I did it as a regular macro (not worksheet_open) to make
it easier to debug.

Sub checkstatus()

'get last row of column a
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
'get range of sttatus column d
Set RangeColD = Range(Cells(2, 4), Cells(LastRow, 4))

RowCount = 1
For Each cell In RangeColD

If cell.Value < "OK" Then

If cell.Offset(Rowoffset:=0, columnoffset:=-1) < Now() Then

cell.EntireRow.Copy _
Destination:=Sheets("sheet2").Cells(RowCount, 1)

RowCount = RowCount + 1
End If


End If

Next cell

End Sub


"Wins07" wrote:

Hello I have a task list that are scheduled on different days. I need help
for a code which will short list task due for the current date and/or not
completed from previous days.

My data are as follows
A B C D
Job No Employee Date_due Status
2501 John 03/16/07
2505 Trish 03/23/07 OK
2518 Paul 04/03/07

Upon opening the workbook It would be great if Job 2501 and 2518 could be
shortlisted say on sheet2, whereas sheet1 would contain the above list.

Anyone can help

Thank you your usual coorperation

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Open Excel Files with Macros Charles A C Excel Discussion (Misc queries) 1 January 9th 07 03:52 AM
how do i run an autoexecute macro in excel robin morris Excel Worksheet Functions 2 July 6th 06 04:36 PM
How can I disable macros after the initial open? Troy Excel Discussion (Misc queries) 4 February 13th 06 03:38 PM
Open Worbook and Disable Macros DMc2005 Excel Discussion (Misc queries) 4 October 1st 05 07:23 PM
How to open a spreadsheet with Macros disabled Mauricio Silva Excel Discussion (Misc queries) 6 March 24th 05 01:59 PM


All times are GMT +1. The time now is 01:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"