Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create, Search, Write <Class>

Status
Not open for further replies.

Aybra1

Programmer
Nov 14, 2005
5
US
Hello,

I've been doing alot of php style programming and now at work have been tasked with an excel task... one of my co-workers suggested a Class type would be the best for me to use...
However i know about Nothing in excel/vba. So here is a brief description of the tool.

It will read the data from a previous day, match it agains the current day. Detect if the status of the work order has changed. Mark the date that the work order changed, and calculate how long that work order has been in that "status." It will take the newData and compare the oldData then modify the information on the oldData sheet to be updatedData. When the report runs the next day, updatedData will become oldData. And the vicious cycle will start all over again.


1. Is a class really the best method for this madness?
2. Any tips on how in the world I'd start this?
3. What is the best "dummy" book you could offer on this?
4. And, do you know any good newbie sites i could go to that would cover some of this content?


I'd appreciate any help you could give me. I'm not asking for code necisarily, just a place to start.


Thank you,

Compl E Tlilost
 


Does the Old Data and New Data reside in the same table (or tables if there header and detail rows)? It would be alot easier, IMHO.

Then you could REPORT Previous and Current in whatever form the user wants.


Skip,

[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue]
 
They will share some header rows, but the oldData (when converted off of the newData page) will lose several headers. It will pretty much come down to 3 headers.

WorkOrder Status DateEnteredStatus

The searchable fields would be the workorder number (does the workorder exist in both sheet, is it new? is it old? is it closed ie Deleted) and the Status (is it in the same status today? if not add a date to that field.)

Pretty much, you would be opening a new downloaded xls file every day and copying the information into the "today" sheet, then running the program and everything would be checked/updated and removed from the "today" sheet, prepairing for it to run tomorrow...


Am I making this harder than I need to be? I do have a tendancy to do that. Especially when dealing with things a little new to me.

Thanks,

Compl E Tlilost
 


Please post a sample of the data in the two sheets.

Skip,

[glasses] [red]Be Advised![/red]
Alcohol and Calculus do not mix!
If you DRINK, don't DERIVE![tongue]
 
WorkOrder_ITEM_KEY DEFECT_STATUS
JY000001 DP

as well as other fields that are of no bother.

the oldData would be something like this.

WorkOrder_ITEM_KEY DEFECT_STATUS DATE_ENTERED_STATUS
JY000001 DP 01/01/06

the dateInStatus would be calculated by detecting a differance between the oldData and newData defectStatus fields

if they are differant, then the dateInStatus is updated, if they are the same: next sub.


Then on a side note, the DATE_ENTERED_STATUS field would be accompanied by a DAYS_IN_STATUS field, but that’s a simple calculation from today’s date - dateInStatus.


As you can see i have the concept put together, just don’t know how to start putting the code together. Class and objects in VBA are completely beyond my intelligence level I’m starting to think.
 

Where is dateInStatus in your example?

Skip,

[glasses] [red]Be Advised![/red]
Alcohol and Calculus do not mix!
If you DRINK, don't DERIVE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top