Results 1 to 4 of 4

Macro to return task/resource names from grid

Threaded View

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    10

    Macro to return task/resource names from grid

    Hi All,

    Another beginner question, I have a list of tasks (column A) and resources (row 1) with hours for each in a grid pattern. I need to run a macro that looks through the grid and finds the hours greater than 0 and then returns the task name and resource name into a new table (from row 7 downwards with tasks in column 1 and resources in column 2). I am using "END" as a stopping point after the very last entry in the grid (cell D5). I've played around with a few different attempts at this, but always getting an error, can someone please help with the code below and see where it is going wrong? I would greatly appreciate any help!

    Sub GenerateList()
    
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    
    i = 2
    j = 2
    k = 7
    
    Do While Cells(i, 5).Value <> "END"
    If Cells(i, j).Value > 0 Then
    Cells(k, 1).Value = Cells(i, 1)
    Cells(k, 2).Value = Cells(1, j)
    k = k + 1
    j = j + 1
    Else
    j = 2
    i = i + 1
    End If
    Loop
    i = i + 1
    j = 2
    
    End Sub
    Last edited by aBc894543; 05-17-2016 at 02:25 PM. Reason: Closing

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro req for Sheet name according to Resource names sorted Day wise
    By Alija_21 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2016, 05:34 AM
  2. How to Hyperlink Resource Drive Auto update for Resource File.
    By Saikrishna12345 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-17-2015, 03:19 AM
  3. Resource management - Rule for resource vs date clashing
    By gwoolley0302 in forum Excel General
    Replies: 1
    Last Post: 07-22-2014, 04:48 AM
  4. [SOLVED] Macro (UDF) to Return Names of Sheets in Which A Particular Record is not found
    By Hackboss007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2014, 01:23 PM
  5. Replies: 3
    Last Post: 07-15-2009, 01:06 PM
  6. Issue with VLOOKUP & Grid names...
    By Gr44 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-15-2008, 05:20 AM
  7. Return Value on Last Line in Grid.
    By robert_shindorf in forum Excel General
    Replies: 4
    Last Post: 10-11-2008, 11:23 PM

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