VBA: Gantt Chart

rwcg2d

New Member
Joined
Jul 11, 2016
Messages
43
I am creating a Gantt Chart with certain events (represented by icons). Each row in my table represents one event, and the type is represented by the naming convention (Icon1,Icon2,Icon3...). These names found within the row will match the Name Manager names of the icons already created in the Legend.

I am having the following issues:
1. ActiveSheet.Shapes(Worksheets("PoAP (Data)").Cells(p, 5).Value).Select (LINE 6)
- "The item with the specific name wasn't found"
- It was working at some point, but somehow stopped and I'm not sure what changed.
2. .ForeColor.RGB = RGB(Cells(i, 6).Value, Cells(i, 7).Value, Cells(i, 8).Value)
- This doesnt error me out, but it comes back as Black every time regardless of which numbers are in the cells.

Code:
Sub Move()
Dim p As Integer
p = 3
Do While Worksheets("PoAP (Data)").Cells(p, 5).Value <> ""
    Sheets("Sheet3").Select
    ActiveSheet.Shapes(Worksheets("PoAP (Data)").Cells(p, 5).Value).Select
    Selection.Copy
    ActiveSheet.Paste
Selection.ShapeRange.Name = Worksheets("PoAP (Data)").Cells(p, 4)
    p = p + 1
Loop


Dim i As Integer
i = 3
Do While Worksheets("PoAP (Data)").Cells(i, 4).Value <> ""
    ActiveSheet.Shapes(Worksheets("PoAP (Data)").Cells(i, 4)).width = Worksheets("PoAP (Data)").Cells(i, 12).Value
    ActiveSheet.Shapes(Worksheets("PoAP (Data)").Cells(i, 4)).height = Worksheets("PoAP (Data)").Cells(i, 11).Value
With ActiveSheet.Shapes(Worksheets("PoAP (Data)").Cells(i, 4)).Fill
        .Visible = msoTrue
        .ForeColor.RGB = RGB(Cells(i, 6).Value, Cells(i, 7).Value, Cells(i, 8).Value)
        .Transparency = 0
        .Solid
End With
    ActiveSheet.Shapes(Worksheets("PoAP (Data)").Cells(i, 4)).Left = Worksheets("PoAP (Data)").Cells(i, 9)
    ActiveSheet.Shapes(Worksheets("PoAP (Data)").Cells(i, 4)).Top = Worksheets("PoAP (Data)").Cells(i, 10)
    i = i + 1
Loop
End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top