+ Reply to Thread
Results 1 to 2 of 2

Sub Procedure Timetable

Hybrid View

guthrie.23 Sub Procedure Timetable 11-04-2010, 11:57 AM
venkat1926 Re: Sub Procedure Timetable 11-05-2010, 12:05 AM
  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Kingston, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    6

    Sub Procedure Timetable

    I need to write a sub procedure that takes a schedule (in table form) and puts it into a timetable (the format is given). Attached is the worksheet, just to the right of the timetable is what it needs to look like once the sub prodecure is run.


    Thanks for the help, I desperately need it!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Sub Procedure Timetable

    there should be at least one blank row between the main data list and the engagement list

    in that case try this macro (SEE THE COMMENTS IN CAPITALS WITHIN THE MACRO)

    Sub test()
    Dim r As Range, c As Range, r1 As Range, t As Date
    Dim loc As Range, cfind As Range
    Set r = Range(Range("A2"), Range("A2").End(xlDown))
    Set r1 = Range("A7")
    'r1 IS THE TOP LEFT CELL OF THE ENGAGEMENT LIST
    'IF IT IS DIFFERENT CHANGE THE STATEMENT REGARDING r1 ABOVE.
    
    For Each c In r
    t = c.Offset(0, 1) & ":00 am"
    Set loc = c.Offset(0, 3)
    Set r1 = r1.CurrentRegion
    Set cfind = r1.Cells.Find(what:=t, lookat:=xlWhole)
    cfind.Offset(0, 1) = c
    cfind.Offset(0, 2) = loc
    Next c
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1