Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 15th, 2007, 08:32 PM
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default populate status values for tracking action items

Hi,
    I need help for the following.How do i achieve this result using vb(i m developing macros using excel)?Thanks alot in advanced:)
I need to populate the results in a new column called 'Action_Status_Update'

For example, Today is 16/05/07 in the month of May.I need to set the value for 'Action_Status_Update' , when the Action_Status='Open' for the next 3 month to 'Due Soon', so that i can send reminder email to the users to remind them that the action item is to be due soon.

Below is the result that i need to achieve.Thanks

[u]Action_Due_Date</u> [u]Action_Status </u> [u]Action_Status_Update</u>
Jan-07 Open Over Due
Jan-07 Closed Done
Feb-07 Open Over Due
Feb-07 Closed Done
Mar-07 Open Over Due
Mar-07 Closed Done
Apr-07 Open Over Due
Apr-07 Closed Done
May-07 Open Due Soon
May-07 Closed Done
Jun-07 Open Due Soon
Jun-07 Closed Done
Jul-07 Open Due Soon
Jul-07 Closed Done
Aug-07 Open Not Due Yet
Aug-07 Closed Done
Sep-07 Open Not Due Yet
Sep-07 Closed Done
Oct-07 Open Not Due Yet
Oct-07 Closed Done
Nov-07 Open Not Due Yet
Nov-07 Closed Done
Dec-07 Open Not Due Yet
Dec-07 Closed Done


Reply With Quote
  #2 (permalink)  
Old May 16th, 2007, 02:47 PM
Friend of Wrox
Points: 513, Level: 8
Points: 513, Level: 8 Points: 513, Level: 8 Points: 513, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2007
Location: Davenport, IA, USA.
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Not sure if you want to call the procedure or have it assigned to a button. I've created a button called Update_Button for the example. The due date would need to be an actual date field or the code won't work without some tweaking.

Assuming your detail starts in row 2, A1 is Action_Due_Date, A2 is Action Status, and Action_Status_Update is A3:
---------------------------------------------------------------------
Private Sub Update_Button_Click

'Changes Due Dates
  Dim dStart As Date, dEnd as Date, iRowOn As Long
  dStart = cDate(Month(Now) & "/" & Day(Now) & "/" & Year(Now))
  dEnd = dStart + 90 'Dates count by number of days, so this sets dEnd 90 extra days out
  iRowOn = 2
  With ActiveSheet
    Do While .Cells(iRowOn, 1).Value & " " <> " " 'Processes until hits first blank cell in Column A
      If UCase(.Cells(iRowOn, 2).Value) = "CLOSED" Then
        .Cells(iRowOn, 3).Value = "Done"
      ElseIf .Cells(iRowOn, 1).Value >= dStart And .Cells(iRowOn, 1).Value <= dEnd Then
        .Cells(iRowOn, 3).Value = "Due Soon"
      ElseIf .Cells(iRowOn, 1).Value > dEnd Then
        .Cells(iRowOn, 3).Value = "Over Due"
      Else
        .Cells(iRowOn, 3).Value = "Not Due Yet"
      End If
      iRowOn = iRowOn + 1
    Loop
  End With

End Sub
---------------------------------------------------------------------

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP status 404-Servlet action is not available matrixbegins Struts 0 October 24th, 2007 11:09 PM
send email via excel for action items with overdue miracles Excel VBA 0 May 16th, 2007 02:20 AM
Work items tracking from Team Foundation Server? woojtii General .NET 0 April 4th, 2007 07:06 AM
summary rpt to help to keep track of action items miracles VBScript 0 April 2nd, 2007 03:11 AM
Ch28 - HTTP Status 503 - Servlet action is current mona3000m BOOK: Beginning JavaServer Pages 0 December 3rd, 2006 04:19 AM



All times are GMT -4. The time now is 02:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.