Consulting

Results 1 to 8 of 8

Thread: Need Help: Updating dates monthly

  1. #1
    VBAX Newbie
    Joined
    Apr 2009
    Posts
    4
    Location

    Need Help: Updating dates monthly

    I am new to all of this, and am just starting to learn my way around VBA. Please help me.

    Where I work, I publish a workbook monthly that displays our equipment list and the dates that the last maintenance was performed on. We recently upgraded to a newer version of Maximo that will give me and excel spreadsheet with the equipment numbers and the dates that I need. I just need a simpler way of importing this data into my monthly workbook.

    My spreadsheet that I get has the PMNUM and the completed dates in it, I get this information monthly, so I will only be inputting one month at a time. I need marches dates in the march column and lined up with their PMNUM row.

    The PMNUM's are organized througout the whole workbook, so this is not limited to just this worksheet.

    I cannot post links yet sorry.


    David
    Last edited by Parker; 04-28-2009 at 03:28 PM. Reason: add workbook

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi David,
    Welcome to VBAX.
    You can post workbooks using Manage Attachments in the Go Advanced reply section. Remember to remove any sensitive data.
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Newbie
    Joined
    Apr 2009
    Posts
    4
    Location
    workbook added.

    Here is the monthly updated information that I receive that has to be imported in.



    Thanks MD
    Last edited by Parker; 04-28-2009 at 04:03 PM. Reason: add another work book

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    The book is empty and has a link to another file.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    There is a problem wit that second file, it won't load.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Newbie
    Joined
    Apr 2009
    Posts
    4
    Location
    fixed the attached documents, everything is viewable now
    Last edited by Parker; 04-29-2009 at 11:07 AM.

  7. #7
    VBAX Newbie
    Joined
    Apr 2009
    Posts
    4
    Location
    Any Ideas?

  8. #8
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [vba]
    Option Explicit
    Sub GetData()
    Dim rng As Range
    Dim Col As Long, Rw As Long
    Dim txt As String
    Dim i As Long, sh As Long
    'get column to be filled
    Col = 3 + 2 * Month(InputBox("Enter Month") & "/" & Format(Date, "yyyy"))
    Set rng = Workbooks("MAXIMO_WorkOrder").Sheets(1).Cells(1, 1).CurrentRegion.Columns(2)
    For i = 2 To rng.Cells.Count
    For sh = 1 To 1
    Rw = 0
    On Error Resume Next
    Rw = Application.Match(rng.Cells(i), Sheets(sh).Columns(29), 0)
    If Rw <> 0 Then
    Sheets(sh).Cells(Rw, Col) = rng.Cells(i).Offset(, -1)
    Sheets(sh).Cells(Rw, Col).Interior.ColorIndex = 8
    Exit For
    End If
    Next
    For sh = 2 To 5
    Rw = 0
    On Error Resume Next
    Rw = Application.Match(rng.Cells(i), Sheets(sh).Columns(29), 0)
    If Rw <> 0 Then
    Sheets(sh).Cells(Rw, Col) = "DONE"
    Sheets(sh).Cells(Rw, Col).Interior.ColorIndex = 8
    Exit For
    End If
    Next
    Next
    End Sub

    [/vba]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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