Results 1 to 10 of 10

Need Urgent Help

This is a discussion on Need Urgent Help within the Off Topic forums, part of the Entertainment category; Right @ work im trying to make life more comfortable for the planners (which im doing this week), I need ...
Page: 1


  1. #1
    Senior Member festo's Avatar
    Join Date
    Mar 2006
    Location
    England
    Posts
    2,820

    Default

    Right @ work im trying to make life more comfortable for the planners (which im doing this week), I need to be able to calculate the daily duration for each "resource".

    Resource 1 = IT - Instrumentation
    Resource 2 = EL - Electrical

    Each job has a given duration and a given resource be it IT or EL. I need to be able to add up the days totals "on the fly" for both IT and EL and give the output on MS Project as a cell in a new column

    If start dates are the same and resource are the same then add up the duration and output it


    If anyone can code this id be truly grateful

    nic00 aka festo

  2. #2
    Community Nazı Senior Member schrotti's Avatar
    Join Date
    Mar 2006
    Location
    nazıland
    Posts
    3,482

    Default

    lazy ass.

  3. #3
    Senior Member festo's Avatar
    Join Date
    Mar 2006
    Location
    England
    Posts
    2,820

    Default

    lazy ass.[/b]
    Its not that im lazy its that i dont have experience with this shit

  4. #4
    TunaFishyMe
    Guest

    Default

    mmm

    how is the information you have formatted? Like how do you know the durations? Is it given on a spreadsheet or soemthing?

  5. #5
    Senior Member festo's Avatar
    Join Date
    Mar 2006
    Location
    England
    Posts
    2,820

    Default



    I just made that up as i dont have any of the work plans at home, but its basically like that

  6. #6
    TunaFishyMe
    Guest

    Default

    what kind of file is Microsoft Project? I can do this if it was an excel spreadsheet...i bet its the same thing but im not sure if it pulls the same way...

    im doing something similar but not really electrical related. I'm pulling information from a spreadsheet into Access and then manipulating from there...All of Microsoft Office is linked with VB so its pretty much the same thing...Is everything handled under Microsoft Project? I am not so familiar with the program but I do know my way around VB.


  7. #7
    Senior Member
    Join Date
    Jul 2007
    Location
    Texas
    Posts
    13

    Default

    what kind of file is Microsoft Project? I can do this if it was an excel spreadsheet...i bet its the same thing but im not sure if it pulls the same way...

    im doing something similar but not really electrical related. I'm pulling information from a spreadsheet into Access and then manipulating from there...All of Microsoft Office is linked with VB so its pretty much the same thing...Is everything handled under Microsoft Project? I am not so familiar with the program but I do know my way around VB.[/b]
    I just took a class on MP. lemme work on it for a sec. trying to remember

  8. #8
    TunaFishyMe
    Guest

    Default

    but i was gonna bribe him to tell me who ranking was

    anyways if you want to know how to do it on access i can write it for you :P or i can write the gist of it but i dont know how to read/print cells with Microsoft Project since Ive never used it.

  9. #9
    Senior Member festo's Avatar
    Join Date
    Mar 2006
    Location
    England
    Posts
    2,820

    Default

    but i was gonna bribe him to tell me who ranking was

    anyways if you want to know how to do it on access i can write it for you :P or i can write the gist of it but i dont know how to read/print cells with Microsoft Project since Ive never used it.[/b]
    Go for it im sure i can alter it on the fly within ms project anyway

  10. #10
    TunaFishyMe
    Guest

    Default

    Imagining this was an excel spreadsheet...this is how you drag it into access...I dont really know if you need this part since its all within that one application.
    I am assuming you are trying to figure out how much time you spent on IT and how much time you spent on EL.

    dim db as dao.database
    dim oFSO, oNet
    dim rstTransport as dao.recordset
    dim etTime as double
    dim itTime as double
    dim i as counter
    dim durationStr As String
    dim numHold as Integer
    dim intRow as Integer
    dim wks as Excel.Workbook

    set oFSO = CreateObject ("scripting.filesystemObject")
    set oNet = CreateObject ("WScript.Network")
    If oDSO.FileExist(filename) Then 'Do this only if the file exists (im pulling the .xls file into the .mdb)
    intRow = StartingRow 'Row the data starts...in your picture itll be 1.
    set wks = appExcel.Worksheet(1) 'First Page
    set db = currentDb
    set rstTransport = db.OpenDynaset("tbl_Info")
    While len(wks.Range("Duration" & intRow).Formula) > 0 'Length of current Duration cell is not 0.
    with rstTransport 'using tbl_Info that is created
    .addNew
    .Fields("Duration") = wks.Range("Duration" & intRow).Value
    ... ' do the same for Type Column.
    .Update
    End With
    intRow = intRow + 1
    Wend


    end IF


    After it is in your database...
    i=0
    while not rstTransport.Eof ' Do this until empty row (no more data)
    i=0
    with rstTransport
    durationString = .fields("Duration")

    while not mid(durationString,i,1) = " " ' Look for space in Duration Field. This is to find the number.
    i=i+1 ' found space'
    Wend
    if lcase(mid(durationString, i+1, 1)) = "m" then
    numHold = int(durationString, 1, i-1)/60 ' Turn it into hours since the beginning number is minutes
    else 'The beginning numbers are hours
    numHold = int(durationString,1,i-1)
    End If

    if .fields("Resource Names") = "EL" then
    etTime = etTime + numHold
    else
    itTime = itTime + numHold
    End If
    end With

    Wend

    then you have to figure out how to put etTime and itTime into a cell cuz i never exported anything into excel before but it shouldnt be hard. I think this is what you need...i might be wrong...my approach can also be wrong since i dont know how MS Project reads the cells. Also I dont know what you mean by the start date...do you only add it if the start dates are the same? Here i just added them all and split them into etTime and itTime. Last I never really took a course in VB(A)..I kinda learned it myself so i dont know if this is the best way...there might be another way but this is the only way i know.

    hope it helps...i can add more if i misunderstood the question.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •