Move multiple shapes wrt dates using VBA

Lazybookwarm

New Member
Joined
Feb 7, 2017
Messages
6
I got data as mentioned below in excel. All the activities are split in two different periods. For each such period I have to create a shape and place it according to its date and duration along the same row. e.g. in the below mentioned table for activity A, I will create two rectangular shapes and I want to place the first shape in the January-17 column (1st Jan to 5th Jan-17) and the second shape in the same January-17 column from 8th Jan-17 to 9th Jan-17. Both these shape shall resize themselves according to their assigned duration. Please let me know ways to do it using VBA or by other methods in excel. Thank you!

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Activity[/TD]
[TD]Dur
(days)[/TD]
[TD]Start[/TD]
[TD]Finish[/TD]
[TD]Dur
(days)[/TD]
[TD]Start[/TD]
[TD]Finish[/TD]
[TD]Jan-17[/TD]
[TD]Feb-17[/TD]
[TD]Mar-17[/TD]
[TD]Apr-17[/TD]
[TD]May-17[/TD]
[TD]Jun-17[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]5
[/TD]
[TD]1/1/17[/TD]
[TD]5/1/17[/TD]
[TD]2[/TD]
[TD]8/1/17[/TD]
[TD]9/1/17[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]6[/TD]
[TD]6/1/17[/TD]
[TD]11/1/17[/TD]
[TD]4[/TD]
[TD]2/4/17[/TD]
[TD]5/4/17[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]7[/TD]
[TD]12/1/17[/TD]
[TD]18/1/17[/TD]
[TD]6[/TD]
[TD]8/5/17[/TD]
[TD]13/5/17[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]8[/TD]
[TD]19/1/17[/TD]
[TD]26/1/17[/TD]
[TD]8[/TD]
[TD]7/2/17[/TD]
[TD]14/2/17[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]9[/TD]
[TD]27/1/17[/TD]
[TD]4/2/17[/TD]
[TD]10[/TD]
[TD]19/2/17[/TD]
[TD]28/2/17[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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