Solved

VBA Excel Gantt

Posted on 2016-10-04
1
79 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

732 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