Solved

VBA Excel Gantt

Posted on 2016-10-04
1
42 Views
Last Modified: 2016-10-19
There is a ActiveProjects sheet with hundreds of projects.
I've attached Final Result and Source files (samples with small sample data).

I'm building the Excel VBA app that will do these steps:


1) Locate and select the correct file with the Raw Data.

2) Open the Template.

3) Select the data from the Range.

4) Clear current Gantt.

5) Select Relevant data from the Raw data and populate first 4 Columns of Gantt.
   - Project Name
   - Budget
   - TCI PM
   - Assisting

6) Run vba code to populate colored horizontal bars of Gantt chart.
   a) populate squares (cells) in proper Q (ex. 2Q 2016) based on the dates from Raw Data.
   b) add new YEAR if necessary (need 6 consecutive years).
   c) drop one YEAR if 1Q-4Q has no colored cells from top to bottom.

I want to see what is the best solution (must use VBA) to select data from the source and based on the dates - color the Cell with one of the 4 colors (Green, Yellow, Orange, Blue). That's all in step 6a.
Gantt.PNG
ActiveProjects.xlsx
0
Comment
Question by:CABRLU63
1 Comment
 
LVL 1

Accepted Solution

by:
Vijay R earned 500 total points
ID: 41828539
Hi
Good solution is to use the find() method. I am providing the snippet of code I have done in my project:
  On Error GoTo Errorcatch
     tasks = Split(taskText, ",")
     taskCount = 0
    For taskno = 0 To UBound(tasks)
        With monitorSheet.Range(Cells(BaseRow, 1), Cells(BaseRow + 41, 1))
           Set found = .Find(tasks(taskno), LookIn:=xlValues)
        End With
        If Not found Is Nothing Then
            With Cells(found.Row(), columnNo)
                .Value = "="
                If found.Row() < 23 Then
                    .Interior.Color = RGB(255, 153, 0)
                Else
                    .Interior.Color = RGB(204, 51, 0)
                End If
I hope this helps. Let me know if it is not clear.
Vijay R
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This is an Add-On procedure to be used in conjunction with the code provided in Reducing EE Email Clutter using Outlook (http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/A_3146-Outlook-Processing-EE-emails-on-Receive.…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now